krupal
krupal

Reputation: 884

How to make my next button to submit form?

I am creating a student information form in html as in the image:

enter image description here

My next button is an image and the code for it is as follows:

<input type="image" id="registersubmit6" name="registersubmit6" src="images/arrow-right.png"  title="finish" onclick=""/>

When user clicks on next button, I want to submit this form and move to next page.How I can do both at the moment?

Should I use javascript or PHP? and if yes then how?

Upvotes: 0

Views: 8396

Answers (1)

T J
T J

Reputation: 43166

<input type="image" id="registersubmit6" name="registersubmit6" src="images/arrow-right.png"  title="finish" onclick="submitForm()"/>
function submitForm(){
document.getElementById('id of your form').submit();
}

Upvotes: 1

Related Questions