Code 1 :
Code: Select all
<FORM ACTION="Query.php">
Name :
<INPUT name=txtName>
<INPUT type="Submit" value="Search" name="Search">
</FORM>Code 2:
Code: Select all
<FORM ACTION="Query.php">
Name :
<INPUT name=txtName>
<INPUT name=dummy>
<INPUT type="Submit" value="Search" name="Search">
</FORM>Code 1 works only if you click the Submit button
Code 2 works if you click the Submit button or hit the enter key in any one of the text fields (txtName or dummy).
So a minimum of 2 text input fileds are required to get it work on hitting the enter key in the fields.
If there is just 1 field we have to click the Submit button.
On hitting the enter key in the txtName field :
Code 1 returns : http://localhost/Query.php?txtName=something
Code 2 returns : http://localhost/Query.php?txtName=some ... rch=Search
In my PHP code I have :
Code: Select all
if (isset(Search))Thanks