javascript - How to prevent from refreshing after submitting? -
i got code right here executes function validate() when submit clicked. function changes of text in page. can't see effect because page automatically refreshes after submission:
<form name="myform" onsubmit="validate(); homecoming false;"> age: <input type="text" name="age" /> height (meters): <input type="text" name="height" /> weight (kilograms): <input type="text" name="weight" /> <input type="submit" value="submit"> </form>
how prevent page reloading after each submission?
you can utilize test button within form
<input type="button" value="test button" onclick="validate();">
once solved, remove button.
you can utilize firebug (or equivalent) add together breakpoint in javascript code.
javascript html forms reloading
No comments:
Post a Comment