473,662 Members | 2,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submitting form

Claus Mygind
571 Contributor
I am having some trouble submitting a form in IE. Works fine with FireFox.

I have tried two methods.

method #1
Expand|Select|Wrap|Line Numbers
  1. function validateForm(form)
  2.     {
  3.        if (document.getElementById("NAME").value == "")
  4.        {
  5.          alert("You left the name blank.");
  6.          return false;
  7.        }else{
  8.          if (document.getElementById("EMAIL").value == "")
  9.          {
  10.            alert("You did not give me an email address.How can I email you!");
  11.            return false;
  12.        }else{
  13.            return true();
  14.  
  15.        }
  16.      }
  17.    }
  18.  
  19. <FORM METHOD=POST     ACTION="myApp.exe" onSubmit="return validateForm(this)">
  20.  
  21. <input type="submit" value="Add My Name To Guest Book">
  22.  
  23.  
method #2
Expand|Select|Wrap|Line Numbers
  1. function validateForm(form)
  2.     {
  3.        if (document.getElementById("NAME").value == "")
  4.        {
  5.          alert("You left the name blank.");
  6.          return false;
  7.        }else{
  8.          if (document.getElementById("EMAIL").value == "")
  9.          {
  10.            alert("You did not give me an email address.How can I email you!");
  11.            return false;
  12.        }else{
  13.            form.submit();
  14.  
  15.        }
  16.      }
  17.    }
  18.  
  19. <FORM METHOD=POST     ACTION="myApp.exe" onSubmit="return false"
  20. >
  21.  
  22. <input type="button"    id = "sendName" name = "sendName"             value="Add My Name To Guest Book" onClick="validateForm(this.form);"> 
  23.  
On option #2 I get an error on the form. It is transmitted as null.
Aug 15 '08 #1
1 1206
Claus Mygind
571 Contributor
Never mind bad coding on my part not shown in example
Aug 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3774
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your HTML form to. the actual form-parsing page resides on a server that's uneditable to me since it sits on an inaccessible server. my problem is more irritating than anything; everything double-submits.. when you submit the form, I've forced a...
2
2215
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of hitting of the enter key was to simply not have a submit button, instead going for a regular anchor which calls a javascript confirmation box and then submits the form.
5
1902
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
1
1655
by: Richard Dixson | last post by:
I have code that calls document.myFormName.submit() to submit a form automatically via JavaScript. This works just fine. However, if there is a button (or other form field element) on the form named "submit", this results in a JS error saying that "the object doesn't support this property or method". I think what is happening in this case is that document.myFormName.submit() is then trying to call a method on the form field element...
1
1522
by: Hello | last post by:
Scenario: A page creates a pop up and that pop up submits a form. Is there a way to detect whether the submitting was successful or not, so true/false could be passed to the parent window?
4
2794
by: Super Steve | last post by:
I'm trying to write a little script that disables the submit button on a form, changes the text of the button, and then submits the form. Can anyone tell me why this works ok: <input type="button" value="Submit" onClick="this.disabled=true; this.value = 'Submitting...'; this.form.submit();"> But when I try to make a function it doesn't work:
3
1895
by: kgbalaji1980 | last post by:
Hi all, i want the jscript coding for more than one form in one page and submitting the same . ie one parent form and one append button when we click that button one child form will display and so on. we have to submitting for the same regards Balaji
18
13120
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the submission if there is an error. Sample (obviously not working code): <html> <head> <script type="text/javascript"> function Submit() {
1
3219
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit button". when "submit" button pressed, call the "servlet" in this popup window and then close the "popup" window. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var X = 200; // change the # at the left for a fixed X co-ordinate to accommodate...
6
4970
by: phpnewbie26 | last post by:
This has been confusing me for a while. I don't understand why it isn't working. In my original coding, I have an action called submitted.php and this is what is looks like: <?php $data=fopen("/home/vchan/ts2/writing.txt","r+"); while(!feof($data)){ $data2=fgets($data); $tmp=explode(",",$data2); $project=$tmp; $code=$tmp;
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8768
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...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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...
0
4181
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
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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.