How can we submit a form without a submit button?

Answer Posted / snc

We can use a simple JavaScript code linked to an event
trigger of any form field. In the JavaScript code, we can
call the document.form.submit () function to submit

Example 1
<form method='post' action='some_action'>
<select name='something' onchange=‘this.form.submit () ;'>
<option value='1'>1</option>
<option value='2'>2</option>
</form>

Example 2
<form method='post' action='something'>
<input type='checkbox' name='something'
onclick=‘this.form.submit ()'>
</form>

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How arrays are passed through arguments?

805


What is php.ini & .htacess file?

737


What is the use of friend function in php?

720


What are php magic methods?

716


What exactly is PHP?

772


How is it possible to know the number of rows returned in the result set?

759


Name some of the functions in php.

676


Can you convert php to html?

710


Which method do you follow to get a record from a million records? (Searching not from database, from an array in php)?

746


Should I learn php before wordpress?

680


What is the difference between explode() and split() functions?

700


What is the difference between single-quoted and double-quoted strings in php?

754


How to register a variable in PHP session?

701


What is the correct syntax of mail() function in php?

751


Tell me what are the different types of errors in php?

698