rewben
08-21-2002, 09:28 AM
hi.
I got a XHTML 1.1 file and i want to post with it, and check if certain inputs are filled in or not, that worked fine with this code :
<!--
function checkformulier(veld)
{
loopdoor = false;
while (true)
{
if (form1.naam.value== null || form1.naam.value=="" || form1.naam.value== form1.naam.defaultValue)
{
form1.naam.select();
form1.naam.focus();
break;
}
if (form1.message.value== null || form1.message.value=="" || form1.message.value== form1.message.defaultValue)
{
form1.message.focus();
form1.message.select();
break;
}
loopdoor = true;
break;
}
if (loopdoor) {document.form1.submit()}
}
//-->
GO TO THE LINK BELOW TO SEE THE FULL CODE
but that worked when you use <form name="form1"> and i because i write xhtml i have to use <form id="form1"> and i have tried it with document.formID.elementname.value== null but thats not working. So does anybody know how to check a form with an idea and no name?
check it out at http://www.generation.nl/~rewben/jn/
I got a XHTML 1.1 file and i want to post with it, and check if certain inputs are filled in or not, that worked fine with this code :
<!--
function checkformulier(veld)
{
loopdoor = false;
while (true)
{
if (form1.naam.value== null || form1.naam.value=="" || form1.naam.value== form1.naam.defaultValue)
{
form1.naam.select();
form1.naam.focus();
break;
}
if (form1.message.value== null || form1.message.value=="" || form1.message.value== form1.message.defaultValue)
{
form1.message.focus();
form1.message.select();
break;
}
loopdoor = true;
break;
}
if (loopdoor) {document.form1.submit()}
}
//-->
GO TO THE LINK BELOW TO SEE THE FULL CODE
but that worked when you use <form name="form1"> and i because i write xhtml i have to use <form id="form1"> and i have tried it with document.formID.elementname.value== null but thats not working. So does anybody know how to check a form with an idea and no name?
check it out at http://www.generation.nl/~rewben/jn/