Script works in Firefox but not IE

R

Rollie72

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">
................
 
R

RobG

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;
...
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top