Jump to content

problem with enter key submit


antonyjohn

Recommended Posts

 

 

hai friends...

 

  there is a problem in one of my forms...this form has got only one text field and a submit button...

 

without using the submit button .i need to submit the data entered in the text field to be inserted into the data base,with directly by pressing the enter key....

 

plzzzzzzz help...

 

Link to comment
https://forums.phpfreaks.com/topic/68818-problem-with-enter-key-submit/
Share on other sites

<script language="javascript">
function submitform(frmObj,pressedascii){
	if(pressedascii == 13){
		frmObj.submit();
	}	
}

</script>

<form name="frmname" action="test1.php" method="post">
<input type="text" name="name" value="" onkeypress="javascript:submitform(this.form,event.Keycode);"

</form>

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.