-3
<form method="POST">
<?php
   if (isset($_GET['name'])){
      $searchname = $_GET['name'];
   }
?>

<table>
    <tr>
            <td>name:</td>
            <td>&nbsp;</td>
            <td><input type='Text' name='name' Value='<?=$searchname?>'></td>
            <td colspan='3'><input type='Submit' value='Search'></td>
    </tr>
</table>
</form>

Above I have a basic variable passed in from another page via URL. This variable is passed into a text box. When I get to the page that this is on, I want to have it search automatically, instead of me pressing the submit button. How does one do this?

user20929302
  • 383
  • 1
  • 4
  • 14

1 Answers1

0

Via jQuery...

$('button.submit').click();

This should do the trick. You can echo this code out via php after certain validation or other php code.

Studocwho
  • 2,404
  • 3
  • 23
  • 29