On Aug 1, 2011, at 10:14 AM, Martín Marqués wrote:
I have a large form with quite a bunch of pull downs to select. Then a
submit button.
The thing is that there can be up to 1300 vars, and maybe more in the
future, but in every post only 10 or 15 are valid for the program. How
can I eliminate them from the list of variables that are finally
submitted?
Hmmmm. Assuming that your base HTML as served to the browser
accurately reflects the current state of the object on your server
before changes, you could test to see if each select's selected option
is the defaultSelected option, and drop it from the serialized
attributes if so. Inside a loop:
if(mySelect.options[mySelect.selectedOption].defaultSelected == true){
//skip this one
}else{
params.push $F(mySelect);
}
Something like that, off the top of my head. That should eliminate any
non-changed elements from the POST. But you should seriously think
about breaking this up along different lines if you've got 1,300
attributes on a single object!
Walter
--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador
--
You received this message because you are subscribed to the Google
Groups "Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
.
To unsubscribe from this group, send email to [email protected]
.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Prototype
& script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.