473,378 Members | 1,479 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

submitting form

Claus Mygind
571 512MB
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 1194
Claus Mygind
571 512MB
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
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...
2
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...
5
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 ----==...
1
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...
1
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
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...
3
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...
18
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...
1
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...
6
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 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.