I want to post automatically when the input value is written. Please can you help? The form is as follows:
<form method="post" action="searchresults.php">
<input type="text" name="searchresult">
<input type="submit">
</form>
I want to post automatically when the input value is written. Please can you help? The form is as follows:
<form method="post" action="searchresults.php">
<input type="text" name="searchresult">
<input type="submit">
</form>
This should be done with jQuery.
$('#toPost').keyup(function(){
$('#sub').click();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form method="post" action="searchresults.php">
<input type="text" name="searchresult" id="toPost">
<input type="submit" id="sub">
</form>
</div>