DaveKstl -> I need help with a Drop Down Validation (6/15/2009 6:54:41)
I have a dynamic drop down that uses ONCHANGE='Form1.submit();' The drop down is populated with a query.
The problem is I do not get form validation when a selection in made in the drop down. If I remove the ONCHANGE='Form1.submit();', it works just fine.
Is there a way to get an Onchange submit to validate a form field? I have other text fields I validate and they work.
Thanks
Dave
TexasWebDevelopers -> RE: I need help with a Drop Down Validation (6/15/2009 18:42:54)
If it's a drop down you don't need to validate for content --it's either there or the form hasn't been submitted. Or do you mean how do you validate the OTHER fields when using onChange Submit? If so, how are you validating now? The Front Page (worthless) validation? Live validation? JQuery? Dojo? ASP?
DaveKstl -> RE: I need help with a Drop Down Validation (6/16/2009 8:18:22)
I am validating other fields using Javascript. The question I have is the OnChange Submit syntax. Does this negate form validation for a drop down?
Dave
TexasWebDevelopers -> RE: I need help with a Drop Down Validation (6/16/2009 10:41:08)
No--you could validate on change and if the field validates then submit. I cannot imagine a form you describe being very user friendly. If you have five form elements and three are text boxes and one is a radio button and one is a drop down then the user would be confused because there isn't a submit button...how would they know that the dropdown fires the form submission? I suppose you could disable the submit button until validation is complete something like this:
function init() { document.getElementById("submit_it").disabled=true; } function checkFields() { // I want to make sure that man1 and man2 are not empty // and that the select field value is also not empty // before enabling the submit button var f1 = document.getElementById("field1").value; var f2 = document.getElementById("field2").value; var f3 = document.getElementById("field3").selectedIndex;