Execute function and subscribe at the same time?
Hello,
we're trying to enhance and optimize the forms in our projects with jQuery, but i don't know if something we want is posible...
nowadays we are using simple javascript to enable and disable elements in our forms, we have a part to execute when the document is loaded and another that is executed with the interaction of the user.
For example, we have a simple select with "Race" : "Caucassian", "African" and "Other", when the user selects something we enable or disable a textfield (where the user specifies the other race) depending of the election; and when the user saves the data and reopen the form to modify the elements, we execute a function that evaluates the value of the select (previously loaded from the database) and enable or disable the textfield.
We need to optimize this because we've got really large forms (sometimes with 400 different fields) and it would be great to do this in 1 step and have one file with the behaviours instead of doing this once for the interaction and once for the reload.
I've been thinking in a way for subscribing to the onchange and execute it at the same time, but i don't know if there's any way of doing that...
Thanks in advance