Thursday, 15 July 2010

html - How to submit form with Javascript -



html - How to submit form with Javascript -

<input type="submit" name="submit" value="submit" onclick="check_form();"></div>

if fields corrects function check_form() homecoming true, want submit form, hwen fields correct, how it. on moments when close javascript alerts form auto submit.

you missing return

<input type="submit" name="submit" value="submit" onclick="return check_form();"></div>

and function

function check_form(){ var isvalid = true; if(.....) { isvalid = false; } homecoming isvalid; }

better yet utilize onsubmit of form since come in key in textbox can submit it.

javascript html forms

No comments:

Post a Comment