This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a sample form below. The issue I'm having is with a function to validate the form. I have some select tags, and the validate function checks to see if the default values are populated. If they are, it instructs the user to select another value. But when I hit submit, one of the values is changed back to the default value, causing the function to return false. Any idea how to address this?
I tried firebug in firefox and the google chrome debugger, nothing. I actually think the function is doing what it's supposed to. Maybe onSubmit isn't the way to go? The thing is, I use this same basic pattern for other forms with no problem. I'm thinking maybe if I change it to a radio selection group that will give me the desired result.
If the function is doing what it's supposed to do, what is the actual problem?
Joined: May 09, 2007
sorry, not clear with my meaning. I meant that maybe the function is doing what it is instructed to do, but I may be instructing it to do the wrong thing. What I want it to do is leave the select values alone when the validateForm func is called.
Is it possible that when submit is hit, it attempts to send the data and resets the select values? The thing is...it's only the first one that changes. The second is left alone. Any combination I try in terms of the order of the select pulldowns has the same result, the 2nd is left alone and the first goes back to the default value. This behavior is the same in chrome, safari and firefox