View Full Version : Check Form update not working with Select element

11-08-2006, 07:02 PM
I have an Update form where I check if any values were changed after someone submits the form.

If no values changed then message pops up and says:
You did not update any information for this Form.
The form will only go to the action page if a value is changed.

It works great but cant get it to work after I add a validation check on select element.

Here is my validation check function that I use for onSubmit:

for (i;i< e.length;i++)
if ((e[i].type == 'text') || (e[i].type == 'textarea') || (e[i].type == 'select'))
if (e[i].value != e[i].defaultValue)
return true;
alert("You did not update any information for this Form.");
return false;

The above checks for text and textarea elements only for changes and wont work with select element.

My select part of the form:

<select name = "myname">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>

11-08-2006, 07:26 PM
Becauase it does not have that property


11-08-2006, 07:34 PM
Anyway I can add or check select element in my update form using JavaScript?