|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Missing Form FieldsI have some CF forms that use dynamic field naming in a loop depending upon some value. Code like: <cfloop index="i" from="1" to="#form.number#"> <cfinput type="text" name="fname_#i#" size="20" maxlength="50" required="yes"> <cfinput type="text" name="lname_#i#" size="20" maxlength="50" required="yes"> </cfloop> Every once in awhile when the user submits the form, one of the fields does not exist on the page processing the form. The error is something like "Element fname_2 is undefined in a Java object of type class coldfusion.filter.FormScope." I've never experienced this myself to be able to look at the source code of the form page, just emails generated from the error. Thus I cannot determine if it's ColdFusion not generating the field or the browser not sending it. This has happened in different browsers, mostly IE (even version 8). Has anyone experienced these types of issues? I've had it on CF 8, CF 9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328206 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Missing Form FieldsDo you have other types of inputs on the page than text inputs? If no option is selected for radio buttons and checkbox inputs, then nothing is submitted to the processing page. Also, you must be passing a list of field names to the processing page somehow, maybe via a hidden input. You could loop through all the inputs you are expecting to be submitted and <cfparam> them so they exist in the form scope. Steve On Tue, Nov 10, 2009 at 1:05 PM, Steve Moore <smoore@...> wrote: > > I have some CF forms that use dynamic field naming in a loop depending upon > some value. Code like: > > <cfloop index="i" from="1" to="#form.number#"> > <cfinput type="text" name="fname_#i#" size="20" maxlength="50" > required="yes"> > <cfinput type="text" name="lname_#i#" size="20" maxlength="50" > required="yes"> > </cfloop> > > Every once in awhile when the user submits the form, one of the fields does > not exist on the page processing the form. The error is something like > "Element fname_2 is undefined in a Java object of type class > coldfusion.filter.FormScope." I've never experienced this myself to be able > to look at the source code of the form page, just emails generated from the > error. Thus I cannot determine if it's ColdFusion not generating the field > or the browser not sending it. This has happened in different browsers, > mostly IE (even version 8). > > Has anyone experienced these types of issues? I've had it on CF 8, CF 9. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328208 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Missing Form FieldsSteve Moore wrote: > I have some CF forms that use dynamic field naming in a loop depending upon some value. Code like: > > <cfloop index="i" from="1" to="#form.number#"> > <cfinput type="text" name="fname_#i#" size="20" maxlength="50" required="yes"> > <cfinput type="text" name="lname_#i#" size="20" maxlength="50" required="yes"> > </cfloop> Since you are using untrusted information, "form.number", it is possible this is a result with somebody tinkering with the form submits you are processing. I.E. They are sending random and|or targeted data to mess with your system and thus have submitted a value for the 'number' field that has no relationship to the number of fname and lname fields in the post request. Just to give you another thing to consider as you track down this issue. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328209 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
RE: Missing Form FieldsBeing that it's a required field, it's interesting that the CF-induced client side error checking isn't picking it up either. A few thoughts: (1) Dump the form scope into your error emails. It may give you some insight. (2) Are you doing any server-side form error checking? Could that be causing an issue? (3) Is it possible that the form is getting submitted by a bot (and therefore, bypassing the CF/JavaScript error checking)? If possible, you might want to throw some CAPTCHA on the form and see if it makes a difference. -S. -----Original Message----- From: Steve Moore [mailto:smoore@...] Sent: Tuesday, November 10, 2009 1:05 PM To: cf-talk Subject: Missing Form Fields I have some CF forms that use dynamic field naming in a loop depending upon some value. Code like: <cfloop index="i" from="1" to="#form.number#"> <cfinput type="text" name="fname_#i#" size="20" maxlength="50" required="yes"> <cfinput type="text" name="lname_#i#" size="20" maxlength="50" required="yes"> </cfloop> Every once in awhile when the user submits the form, one of the fields does not exist on the page processing the form. The error is something like "Element fname_2 is undefined in a Java object of type class coldfusion.filter.FormScope." I've never experienced this myself to be able to look at the source code of the form page, just emails generated from the error. Thus I cannot determine if it's ColdFusion not generating the field or the browser not sending it. This has happened in different browsers, mostly IE (even version 8). Has anyone experienced these types of issues? I've had it on CF 8, CF 9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328210 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Missing Form FieldsThe missing fields are always text fields. I dump the form scope in my error email I receive and the field does not exist. Not in the FIELDNAMES field either. Doubt they are from bots as the rest of the content seems valid user input. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328285 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Missing Form Fieldsas Ian has said, the problem is likely to do with your #form.number# variable: somehow its value when you were building your form fields, and its value on the form's action page is not the same. check your code that sets its value and look for any code that may change it... are you building your form fields in an indexed cfloop? e.g. <cfloop from=1 to=10 index="x"> ...form fileds created here </cfloop> Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ On 12/11/2009 07:40, Steve Moore wrote: > The missing fields are always text fields. I dump the form scope in my error email I receive and the field does not exist. Not in the FIELDNAMES field either. Doubt they are from bots as the rest of the content seems valid user input. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328286 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
| Free embeddable forum powered by Nabble | Forum Help |