Forum Discussion
VikasB
7 years agoBoss
html:
<form method="post" name="form1" id="form1"> <input id="submit" name="submit" type="submit" value="Submit" onclick="eatFood();" /> </form>
Javascript: to submit the form using javascript
function eatFood() { document.getElementById('form1').submit(); }
to show on click message
function eatFood() { alert('Form has been submitted'); }
Related Content
- 2 years ago
- 6 years ago