473,658 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submit onlick prompt not working with IE??!!

Hello,

Very odd this?

I have a form which has

<input name="Submit" type="Submit" value="Click to send _
when finished" onclick="getNam e()">

and

function getName() {
var yourname = prompt("please give your first name and _
second name","type first name and second name here");
document.demoFo rm1.name.value = yourname;
}

This works OK with Firefox but not with Internet Explorer! No window
comes up asking for the name - just skips this part and sends the form
info by email.

Why should this be?!

Cheers

Geoff
Apr 10 '07 #1
4 2278
Geoff Cox said the following on 4/10/2007 4:40 AM:
Hello,

Very odd this?

I have a form which has

<input name="Submit" type="Submit" value="Click to send _
when finished" onclick="getNam e()">

and

function getName() {
var yourname = prompt("please give your first name and _
second name","type first name and second name here");
document.demoFo rm1.name.value = yourname;
}

This works OK with Firefox but not with Internet Explorer! No window
comes up asking for the name - just skips this part and sends the form
info by email.

Why should this be?!
Because the form is getting submitted before the prompt comes up.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 10 '07 #2
On Tue, 10 Apr 2007 08:38:09 -0400, Randy Webb
<Hi************ @aol.comwrote:
>Geoff Cox said the following on 4/10/2007 4:40 AM:
>Hello,

Very odd this?

I have a form which has

<input name="Submit" type="Submit" value="Click to send _
when finished" onclick="getNam e()">

and

function getName() {
var yourname = prompt("please give your first name and _
second name","type first name and second name here");
document.demoF orm1.name.value = yourname;
}

This works OK with Firefox but not with Internet Explorer! No window
comes up asking for the name - just skips this part and sends the form
info by email.

Why should this be?!

Because the form is getting submitted before the prompt comes up.
Randy,

I don't think so because it works for me with IE and Mozilla - someone
else does not see the prompt with IE, not even after the form has been
submitted.

Cheers

Geoff
Apr 10 '07 #3
Lee
Geoff Cox said:
>
On Tue, 10 Apr 2007 08:38:09 -0400, Randy Webb
<Hi*********** *@aol.comwrote:
>>Geoff Cox said the following on 4/10/2007 4:40 AM:
>>Hello,

Very odd this?

I have a form which has

<input name="Submit" type="Submit" value="Click to send _
when finished" onclick="getNam e()">

and

function getName() {
var yourname = prompt("please give your first name and _
second name","type first name and second name here");
document.demo Form1.name.valu e = yourname;
}

This works OK with Firefox but not with Internet Explorer! No window
comes up asking for the name - just skips this part and sends the form
info by email.

Why should this be?!

Because the form is getting submitted before the prompt comes up.

Randy,

I don't think so because it works for me with IE and Mozilla - someone
else does not see the prompt with IE, not even after the form has been
submitted.

Cheers

Geoff
Avoid using the onclick handler of a submit element.
Using the onsubmit handler of the form is more reliable.
Neither should be used to obtain more information from the user,
since there's little opportunity to validate the new data.
--

Apr 10 '07 #4
On 10 Apr 2007 08:37:59 -0700, Lee <RE************ **@cox.netwrote :

>Avoid using the onclick handler of a submit element.
Using the onsubmit handler of the form is more reliable.
Neither should be used to obtain more information from the user,
since there's little opportunity to validate the new data.
Thanks Lee, in fact I have gone back to using a simple text box!

Cheers

Geoff
Apr 10 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
14639
by: Syed Ali | last post by:
Hello, I have 1 HTML form with 4 submit buttons and 10 textfield entry areas. If submit button1 is pressed I need to make sure that all 10 textfield entries have been filled before submitting the form. If submit button2 is pressed I need to make sure that only textfied1 is filled before submitting the form.
2
1570
by: Kenneth | last post by:
Is there anyway to create a javascript function to submit a form in the same html file?
3
10263
by: sancha | last post by:
Hi, i am in a bit of a delima here. I need to submit an action through javascript so i used document.forms.action='/search.do?&submitaction=Add Minus' document.forms.submit(); since i am working on struts then submitaction maps to through the
4
4930
by: gimme_this_gimme_that | last post by:
Hi, This is sort of a : How to build a Yes/No dialog box qquestion. Or perhaps a question about getting javascript variables from a pop-up window and processing them on a submit. This is what I'd like to have happen :
1
2802
by: Mark | last post by:
Hi - on my site, overnight, my submit buttons have suddenly stopped working in IE. Firefox is fine. The link button works perfectly - the two submit buttons however do not. It works in IE locally - can anyone please advise what may be wrong? Thanks, Mark ASPX:
3
2333
by: Amer Neely | last post by:
I have a simple form that is giving me grief in IE (6) and has me stumped. It works fine with Mozilla. No JavaScript involved. Visit http://www.softouch.on.ca/cgi-bin/confirmation_ie.pl Other forms I have work fine with IE & Mozilla. For some reason the submit button on this form is not working properly. It DOES submit the form as evidenced by the date/time change. What it should do on an empty submit is generate a new image. But it...
0
1432
by: V1RuZ | last post by:
Hi all, I'm having some trouble getting my php code to work properly. I'm submitting three different variables from a vxml form to my php. I then need the php to deposit the variables into files and update a mysql database accordingly, but it's not quite doing what I want it to. The code is run from a webserver via an AIX server. Here's my php code that I got so far: <?php
4
5504
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't call a form's submit. I've found how to post programatically, but I need to use the form's target attribute so that the response goes into another frame, and I can't figure out how to do that programatically.
13
10555
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the user clicks "yes" or "no". This Object is attached to various HTML elements on the page (buttons, selects etc) and traps any events that they raise that cause the page to submit. If the user has not responded, the Object should cancel the page...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.