I got a form, and I want to send hidden input by javascript, how to do it?
F.ex:
<input id="total" type="hidden" value="" name="total" />
And when someone click submit I want to set it value
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you trying to instantaneously change the value of the hidden input? Something like that can be achieved with the
onsubmitevent, of course.The above code will listen to the submit event on the submit button and when triggered, it will change the value of the hidden input. To go into further detail with any answer, we’d need a more descriptive question. Otherwise, I really don’t know what you want.