S
SAN CAZIANO
is there a function that get the name of the first input field of the
current form ?
in my example below I want create an array of form field name and in the
onsubmit assign all element's name to create a simple iteration to test if
some elements in my array, that must be required, are null:
something like function verify(array of string) and in onsubmit something
like return onsubmit(field1,field2,field3....)
<HTML>
<HEAD>
<TITLE>Confirm Dialog Test</title>
<SCRIPT LANGUAGE=JAVASCRIPT>
function verify()
{
if(document.forms[0].GetElementById[0].value=="")
{
alert("Please enter a value in the field");
return false;
}
else{
return true;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM onSubmit="return verify()">
Name: <INPUT TYPE=TEXT NAME="myName"><BR>
<INPUT TYPE=SUBMIT VALUE="Submit">
</FORM>
</BODY>
</HTML>
current form ?
in my example below I want create an array of form field name and in the
onsubmit assign all element's name to create a simple iteration to test if
some elements in my array, that must be required, are null:
something like function verify(array of string) and in onsubmit something
like return onsubmit(field1,field2,field3....)
<HTML>
<HEAD>
<TITLE>Confirm Dialog Test</title>
<SCRIPT LANGUAGE=JAVASCRIPT>
function verify()
{
if(document.forms[0].GetElementById[0].value=="")
{
alert("Please enter a value in the field");
return false;
}
else{
return true;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM onSubmit="return verify()">
Name: <INPUT TYPE=TEXT NAME="myName"><BR>
<INPUT TYPE=SUBMIT VALUE="Submit">
</FORM>
</BODY>
</HTML>