Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Does anyone know why Safari browser does not submit on enter key.

Reply
Thread Tools

Does anyone know why Safari browser does not submit on enter key.

 
 
zazzaron@cox.net
Guest
Posts: n/a
 
      12-20-2005
Does anyone know why Safari browser does not submit on the enter key.

Here's the asp page - its very simple. I click on the radio button then
hit enter - no submit. If my focus is on a textbox all works fine.

<HTML>
<HEAD>
<TITLE>enter test</TITLE>
<script language="javascript">
function validate()
{

alert('validate');
return true;
}
</script>

</HEAD>
<form name="form1" id="form1" method="post" onSubmit="return
validate()">
<input type="radio" name="Amt" id="Amt">
<font>Pay Total Amount</font>
<input type="text" name="textfield2" size="12" >
<input type="text" name="textfield1" size="12" >
<input type="submit" id="xsubmit" name="xSubmit" value="Submit
Payment">
</form>
</CENTER>
</BODY>
</HTML>

 
Reply With Quote
 
 
 
 
Edd
Guest
Posts: n/a
 
      12-20-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Does anyone know why Safari browser does not submit on the enter key.
>
> Here's the asp page - its very simple. I click on the radio button then
> hit enter - no submit. If my focus is on a textbox all works fine.
>
> <HTML>
> <HEAD>
> <TITLE>enter test</TITLE>
> <script language="javascript">
> function validate()
> {
>
> alert('validate');
> return true;
> }
> </script>
>
> </HEAD>
> <form name="form1" id="form1" method="post" onSubmit="return
> validate()">
> <input type="radio" name="Amt" id="Amt">
> <font>Pay Total Amount</font>
> <input type="text" name="textfield2" size="12" >
> <input type="text" name="textfield1" size="12" >
> <input type="submit" id="xsubmit" name="xSubmit" value="Submit
> Payment">
> </form>
> </CENTER>
> </BODY>
> </HTML>
>


There's no action attribute on the form tag...this may be the answer.
Put action="somescript.asp" in <form>, and set your validate function to
return false to stop it trying to navigate there for the moment.

Since it's a validation function, I imagine you'll want it to return
false if there is a validation error, and return true (thus submitting
the form) if there isn't.

--
Edd
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
STRUTS- <html:submit> does not submit on pressing Enter key Megha Vishwanath Java 2 10-02-2009 12:52 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
capturing from text area Shft+Enter, Control+Enter, Alt+Enter and browser issue. HopfZ Javascript 0 08-28-2006 10:11 AM
Form submit - hitting enter does not trigger Submit button ASP General 2 10-25-2004 03:37 PM
STRUTS-<html:submit> -Hitting enter key does not submit the form Megha Vishwanath Javascript 3 07-20-2004 05:45 AM



Advertisments