html:
Expand|Select|Wrap|Line Numbers
- <html-el:form action="${target}" onsubmit="return testTheForm(this)">
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- function testTheForm(theForm){
- var e;
- for (i=0; i<theForm.elements.length; i++){
- e = theForm.elements[i];
- if (e.nodeName == 'SELECT')
- { if (!e.disabled && e.selectedIndex == -1){return false;} }
- }
- return true;
- }
- </script>
This works fine on Firefox as well as when I put the code inline as part of the onsubmit:
Expand|Select|Wrap|Line Numbers
- <html-el:form action="${target}" onsubmit="for (i=0; i<this.elements.length; i++){
- var e = this.elements[i];
- if (e.nodeName == 'SELECT')
- { if (!e.disabled && e.selectedIndex == -1){return false;} }
- }return true;">
Any ideas? I have googled this error with no satisfactory solutions yet.
Thanks.
-Tim