Scope URL, duplicate of form scope - handling with cfform cfinput

Hi Team,

Am running lucee version 6.2.0.32.
At that time of submitting the form, I passed the record_id as a query string through URL, Same via form.
On developer tool, Under network tab, am getting same key values on basis of URL & FORM.
When try to accessing those variable with URL or form scope, it is not a simple variable. It is an array & getting an error…

Query strings

image

Form variable:
image

Output:

image

It should be a simple string instead of getting complex array object.

can you post an example?

<cfscript>
    dump(server.lucee.version);
    src=fileRead(getCurrentTemplatePath());
</cfscript>

<cfoutput>
    <pre>#htmleditformat(src)#</pre>
</cfoutput>

<form action="?list_id=1" method="POST">
    <input type="hidden" name="list_id" value="2">
    <input type="submit">
</form>

<cfscript>
    dump(var=form, label="form");
    dump(var=url, label="url");
</cfscript>

@Zackster, Try with cfform & cfinput

Sample code

image

Sample output

image

Thanks!

Ahhh, I think you have

  1. “Merge URL and Form” enabled?
  2. this.sameFormFieldsAsArray = true; set in your Application.cfc?

4 Likes

Thanks Zac, for getting me in a right direction.
Yes, now working fine once I disable this option.

3 Likes