Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Script works in Firefox but not IE

Reply
Thread Tools

Script works in Firefox but not IE

 
 
Rollie72
Guest
Posts: n/a
 
      02-21-2007
Hello,

This is a first time post for me.

Have this HTML form being validated by a javascript. I am having a
problem with the line "document.ACLinfo.BUmanager.value=manager;" .
When in Firefox this line executes correctly , the BUmanager field is
updated and the information is passed to the cgi script. When in IE it
appears not to execute properly, the resulting cgi script still
contains the default value and was not overwritten with the value
entered by the user.

Please if anyone can shed some light on this matter.

Thanks

<HTML>
<head> <title> HTML Form for the Network Software Group </title>
<script type="text/javascript">
function Validate()
{

if(document.ACLinfo.choice.value=="2")
{
var manager=prompt("Please enter the managers name of the business
unit requesting the change","")
if(name!=null && name!="")
{
document.ACLinfo.BUmanager.value=manager;
}
}
}
</script>
</head>
<BODY>
<FORM METHOD="POST" NAME="ACLinfo" ACTION="XXXXXXXXXXXXX.cgi"
onSubmit="return Validate();">
<hr style="WIDTH: 550px" align="center">
</P>
<TABLE>
..............

<INPUT TYPE="HIDDEN" NAME="BUmanager" VALUE="Default">
................

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      02-21-2007
On Feb 22, 7:51 am, "Rollie72" <(E-Mail Removed)> wrote:
> Hello,
>
> This is a first time post for me.
>
> Have this HTML form being validated by a javascript. I am having a
> problem with the line "document.ACLinfo.BUmanager.value=manager;" .
> When in Firefox this line executes correctly , the BUmanager field is
> updated and the information is passed to the cgi script. When in IE it
> appears not to execute properly, the resulting cgi script still
> contains the default value and was not overwritten with the value
> entered by the user.
>
> Please if anyone can shed some light on this matter.
>
> Thanks
>
> <HTML>
> <head> <title> HTML Form for the Network Software Group </title>
> <script type="text/javascript">
> function Validate()


It is a convention that a function name starting with a capital letter
indicates a constructor.


> {
>
> if(document.ACLinfo.choice.value=="2")
> {
> var manager=prompt("Please enter the managers name of the business
> unit requesting the change","")
> if(name!=null && name!="")


Where does the value for name come from? Do you mean:

if (manager != null && manager != "")



> {
> document.ACLinfo.BUmanager.value=manager;
> }
> }}
>
> </script>
> </head>
> <BODY>
> <FORM METHOD="POST" NAME="ACLinfo" ACTION="XXXXXXXXXXXXX.cgi"
> onSubmit="return Validate();">


You can make life easier if you pass a reference to the form from the
submit handler:

... onsubmit="return Validate(this);" ...

Then in the function:

function Validate(form) {
if (form.choice.value == "2")
...
form.BUmanager.value = manager;
...
}


--
Rob

 
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
Simple script works in Firefox but not IE7 garey Javascript 19 05-07-2009 06:37 PM
Script works in Firefox and Chrome, but not in IE7 garey Javascript 1 04-29-2009 11:10 PM
simple script inserted in websurvey software works in firefox but not in internet explorer gray_slp Javascript 3 06-27-2007 02:56 AM
Works in IE but not in firefox (not sure if syntax is correct) chrisgibson Firefox 0 08-26-2006 04:01 AM
Script Works in Explorer but Not in Firefox goober Javascript 6 05-27-2006 02:58 PM



Advertisments