By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,603 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,603 IT Pros & Developers. It's quick & easy.

Script works in Firefox but not IE

P: n/a
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<titleHTML 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">
................

Feb 21 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On Feb 22, 7:51 am, "Rollie72" <rolandgl...@shaw.cawrote:
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<titleHTML 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

Feb 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.