P
Phil_Cam
Hello All
On a webpage I have a standard paypal image button for purchases. I am
trying to set it up so that it only shows up or is endabled when text
is entered into a textbox and a button is pressed. To do this I set the
type to hidden and changed the type of the button using javascipt to
image. This works perfectly in Modilla's Firefox but in IE it says
there is a scipt error.
Here is the javascipt
<script type="text/javascript">
function UpdateFields() {
if (UsernameForm.txtUserName.value == "") {
var msg = "Please enter a User Name";
alert(msg);
return;
}
document.form8130.btnSubmit.type = "image";
document.form8130.on0.value = UsernameForm.txtUserName.value;
} //disabled="true"
</script>
The paypal button is setup as follows
<form name ="form8130" target="paypal"
action="https://www.paypal.com/cgi-bin/webscr" method="post">
<div align="center"><b><font color="#FFFFFF" size="-1"
face="Arial,Helvetica,Geneva,Sans-serif,sans-serif">
<input name="btnSubmit" type="hidden"
src="../../../images/Paypal/sc-but-03.gif" alt="Pay for your locomotive
with PayPal - it's fast, free and secure!" width="106" height="24"
border="0">
</font></b></div>
</form>
If I remove the following line from the script then I do not get the
error in IE
document.form8130.btnSubmit.type = "image";
Can anyone see what I have done wrong here? Is there another way to
enable or disable an image button?
Thanks in Advance
Phil
On a webpage I have a standard paypal image button for purchases. I am
trying to set it up so that it only shows up or is endabled when text
is entered into a textbox and a button is pressed. To do this I set the
type to hidden and changed the type of the button using javascipt to
image. This works perfectly in Modilla's Firefox but in IE it says
there is a scipt error.
Here is the javascipt
<script type="text/javascript">
function UpdateFields() {
if (UsernameForm.txtUserName.value == "") {
var msg = "Please enter a User Name";
alert(msg);
return;
}
document.form8130.btnSubmit.type = "image";
document.form8130.on0.value = UsernameForm.txtUserName.value;
} //disabled="true"
</script>
The paypal button is setup as follows
<form name ="form8130" target="paypal"
action="https://www.paypal.com/cgi-bin/webscr" method="post">
<div align="center"><b><font color="#FFFFFF" size="-1"
face="Arial,Helvetica,Geneva,Sans-serif,sans-serif">
<input name="btnSubmit" type="hidden"
src="../../../images/Paypal/sc-but-03.gif" alt="Pay for your locomotive
with PayPal - it's fast, free and secure!" width="106" height="24"
border="0">
</font></b></div>
</form>
If I remove the following line from the script then I do not get the
error in IE
document.form8130.btnSubmit.type = "image";
Can anyone see what I have done wrong here? Is there another way to
enable or disable an image button?
Thanks in Advance
Phil