[OT] Question on javascript
Jeff Portwine
jdport at VERITIME.COM
Wed Jun 1 07:28:01 PDT 2005
let me do a little digging... I had this same issue once where I didn't want
the user to submit the form by hitting enter, and to only be able to submit
by pressing the submit button. I found some code that allowed me to
disable submitting from hitting enter in IE, but it wouldn't work for
Mozilla... and it seems that i got around the problem some other way in
mozilla but i can't remember just what i did or what the situation was.
I'll see if I can find it, and if it applies to your situation :)
-Jeff
----- Original Message -----
From: "Stephen Woodbridge" <woodbri at SWOODBRIDGE.COM>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Saturday, May 28, 2005 2:15 PM
Subject: [UMN_MAPSERVER-USERS] [OT] Question on javascript
> Hi,
>
> This is a little of topic, but it is related to building a web interface
> for mapserver.
>
> I have form in html that I do NOT want to submit.
>
> http://swoodbridge.com/~woodbri/t.html
>
> enter text in location and hit [enter], the form starts a submit and
> calls nosubmit() which puts up an alert and then return false; which
> should cancel the submit. But it does the submit anyway :(
>
> This is really annoying because I figure I'm doing something stupid, but
> I just don't see it.
>
> Any help would be appreciated.
> -Steve W.
>
> the html is:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <title>Submit Test</title>
>
> <script type="text/javascript">
>
> function nosubmit()
> {
> alert('nosubmit');
> return false;
> }
>
> </script>
>
> </head>
> <body>
> <form onsubmit="nosubmit();">
> Location: <input type="text" name="address" size="40">
> <input type="button" value="Go" onclick="alert('hello')">
> </form>
> </body>
>
> </html>
>
More information about the MapServer-users
mailing list