evergreean43
Technical User
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 which has only one value selection choice (not multiple):
Here is my validation check:
The above checks for text and textarea elements only for changes and wont work with select element.
My select part of 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 which has only one value selection choice (not multiple):
Here is my validation check:
Code:
e=myform.elements;
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:
Code:
<form....
<select name = "myname">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
</select>
..
</form>