I have an html form, in the form tag, onSubmit="return isReady(this)". The function works through all the textboxes on the form, if they are completed, rewrites the label and textbox with the value of the textbox inside, if not, writes the textbox label in red and another textbox. Essentially, I'm redrawing the entire form in the function, with form tags and a submit button. The function works fine, and so does the submit button inside the form. I also had a counter inside each red draw, and if the counter is 0, return true;, if not show the form and the submit button. The problem is if on the second try the form is still not properly filled in, I want the function to resubmit to itself. Right now, I have in the form tag in the function, onSubmit="return isReady(this)". This does absolutely nothing!
Does anyone have any ideas?
if (counter > 0)
{
document.write('<h3><font color="#ff0000">The fields in red are required.</font></h3>');
document.write('<tr><td><INPUT type="submit" value="Submit" id=submit2 name=submit2></td></tr>');
document.write('</table></form>');
return false;
//reset counter
counter = 0;
}
else
{
return true;
}
If it draws the page, it should be returning false to itself too, no?
Thanks for any help.
Does anyone have any ideas?
if (counter > 0)
{
document.write('<h3><font color="#ff0000">The fields in red are required.</font></h3>');
document.write('<tr><td><INPUT type="submit" value="Submit" id=submit2 name=submit2></td></tr>');
document.write('</table></form>');
return false;
//reset counter
counter = 0;
}
else
{
return true;
}
If it draws the page, it should be returning false to itself too, no?
Thanks for any help.