Jump to content

enter button on screen...


rsammy

Recommended Posts

i am working on a php screen. there is just one field in this screen and then a 'submit' button. i enter some info on the screen and hit enter(focus is still on the text field). how do i submit the form without tabbing to the submit button? is there a way to do this?

 

this is my field:

<tr>
<td width="161"> <div align="right"><font class="inputLbl">Location
    Name:  </font></div></td>
<td colspan="2"> <input name="orgname"  type="text"  class="txtboxLarge" id="orgname" onBlur="javascript:changeCase(document.addNewLoc.orgname);">
  <font class="redTxt">*</font> </td>
</tr>
<tr>
<td width="161"> </td>
<td colspan="2"> <input class="sbttn" type="submit" name="action" value="Submit">
</td>
</tr>

 

and this is what im doing when i submit the form:

<td width="456" align="left" valign="top"> <form action="addlocation.php" method="post" name="addNewLoc" id="addNewLoc" onSubmit="return validate()">

Link to comment
https://forums.phpfreaks.com/topic/100723-enter-button-on-screen/
Share on other sites

thanx ben! im tryin it out, does not seem to work. i need to use this feature along with this one:

<td width="456" align="left" valign="top"> <form action="addlocation.php" method="post" name="addNewLoc" id="addNewLoc" onSubmit="return validate()">

 

when submit button in clicked, validate() javascript function in executed(this function validates for blank field and returns an error message when field is left blank). i still need to do this along with the new feature (hitting enter should submit the form).

 

hope im clear with my requirement. thanx once again. help here will be really really great.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.