>from the form struct. One way to handle it might be to shadow all of
>your form fields with a hidden input called "fields" like this:
>
><form action="" method="post">
> <input name="firstName" type="text" size="20" />
> <input name="fields" type="hidden" value="firstName" />
>
> <input name="lastName" type="text" size="20" />
> <input name="fields" type="hidden" value="lastName" />
>
> <input type="submit" value="Submit Me" />
></form>
>
>when you submit it you will have the following three form variables:
>#FORM.FIRSTNAME#, #FORM.LASTNAME#, #FORM.FIELDS#
>
>and #FORM.FIELDS# will be a comma-delimited ordered-list of form fields
>with the casing you desire. "firstName,lastName"
>
>an even SLICKER way to go would be to have a standard _javascript_
>function iterate through the form fields and write the list in a hidden
>value during an onSubmit. If you want I can write that function for
>you. Just pay me via paypal... :-P *joke*
>
Thanks for confirming what I thought. I decided to use the hidden field
route with a _javascript_ call. However, I didn't use your code (sorry!). I
decided to use God's gift to client-side validation instead (which goes by
the name qForms). Here's my solution in case it may help others out:
objForm = new qForm("frmProperties");
objForm.>
function storeFormFields() {
var str = "";
var struct = objForm.getFields();
var key = "";
for ( key in struct ) {
// We don't want to pass the Submit button and the hidden
// field as values, so do a simple conditional check to
// exclude them
if ( key != 'update' && key != 'keyNames' ) {
str += key + ",";
}
}
objForm.keyNames.setValue(str);
}
As you can see, it's much less cumbersome and easier for other developers to
come in and sift through because qForms abstracts so much of the mess of
looping and evaluating. I love qForms.
Regards,
Dave.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

