Submit a form without submit button and javascript submit
We mostly prefer php form submit either using javascript or normal submit.
But we can submit a form without submit button and javascript
have a look at the below code
<?php
if(isset($_POST['submit_x']) && isset($_POST['submit_x']))
{
echo $_POST['first_name'];
echo $_POST['last_name'];
// Save logic
}
?>
<form method="post">
<lable>First Name</lable>
<input type="text" name="first_name" >
<lable>Last Name</lable>
<input type="text" name="last_name" >
<input type="image" name="submit"/>
</form>
0 comments:
Post a Comment