How can we submit a form without a submit button?

Answers were Sorted based on User's Feedback



How can we submit a form without a submit button?..

Answer / ravindra chouhan

submit a form without a submit button with the help of
javascript code.

Is This Answer Correct ?    35 Yes 3 No

How can we submit a form without a submit button?..

Answer / anand chowdhary

This is the prefect answer:

<html><body>
<form action="what_ever.ext" method="post" name="MyForm">
<input type="hidden" name="hiddenfield1" value="<? echo $some_important_value; ?>">
</form>

<script language="javascript" type="text/javascript">
document.MyForm.submit();
</script>
<noscript><input type="submit" value="verify submit"></noscript>
</body></html>

Is This Answer Correct ?    18 Yes 4 No

How can we submit a form without a submit button?..

Answer / vikas uniyal

We have to use a javascript function:-


<script language="javascript" type="text/javascript">
document.formname.submit();
</script>

Is This Answer Correct ?    13 Yes 0 No

How can we submit a form without a submit button?..

Answer / hitesh shrimali

we can submit form by submit(); function of javascript.

for example:
<form name='xyz' method='post'>
<select name='select' onchange="this.form.submit();">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
</select>
</form>

Is This Answer Correct ?    5 Yes 0 No

How can we submit a form without a submit button?..

Answer / selvabalaji

-Submit a form using javascript onclick fuction.

-Submit a form by selecting a option from drop down box using
onchange event

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More PHP Interview Questions

Why is php used?

0 Answers  


Is php good for career?

0 Answers  


Explain what does the function get_magic_quotes_gpc() means?

0 Answers  


how we can crop an image and how we can display it..

1 Answers   Satyam,


how can i disable multiple user in the same password in my website using any scripts

1 Answers  


What is a model in php?

0 Answers  


Does jwt protect against csrf?

0 Answers  


What are the security measures we have to take for our site not to hack by others.

3 Answers   Infosys, Torque Infotech,


What are the differences between php3 and php4 and php5? What is the current stable version of php? What advance thing in php7?

0 Answers  


What is a comment in php?

0 Answers  


How can we change the maximum size of the files to be uploaded?

0 Answers  


What type of language is php?

0 Answers  


Categories