mattyboi
04-28-2006, 09:47 PM
I've been tryin to figure out why I am getting this error for some time now. Any ideas?
<script language="Javascript">
<!--
var lead_id = "<?php echo $LeadID; ?>"
if (lead_id > "") {
var state = "<?php echo $row['State']; ?>";
var confirmer = "<?php echo $row['Confirmer']; ?>";
var day = "<?php echo $row['ApptDay']; ?>";
if (state == "MD") {
alert("hi");
document.forms['form1'].state.options[0].selected = true;
}
}
//-->
</script>
state is equal to MD so I am getting the alert "hi", but it breaks right there and gives me this error.
document.forms.form1 has no properties
heres my form tag:
<form name="form1" id="form1" action="ticketformpro.php?LeadID=<?php echo $LeadID; ?>" method="post">
<script language="Javascript">
<!--
var lead_id = "<?php echo $LeadID; ?>"
if (lead_id > "") {
var state = "<?php echo $row['State']; ?>";
var confirmer = "<?php echo $row['Confirmer']; ?>";
var day = "<?php echo $row['ApptDay']; ?>";
if (state == "MD") {
alert("hi");
document.forms['form1'].state.options[0].selected = true;
}
}
//-->
</script>
state is equal to MD so I am getting the alert "hi", but it breaks right there and gives me this error.
document.forms.form1 has no properties
heres my form tag:
<form name="form1" id="form1" action="ticketformpro.php?LeadID=<?php echo $LeadID; ?>" method="post">