Hi. I have a basic HTML page with many text boxes and drop-downs set up in a table (no form tags). The last drop-down has two choices. Based on that choice, the user is redirected to the next page. I created a Javascript function to handle the redirection and call it from the select tag, and it works fine. However, only that last drop-down appears now when I access the html page. All the previous text boxes and drop-downs do not appear.
I tested just adding the function, which I put between the <head>/</head> tags, and none of the fields in the form appear. Once I add the Javascript call to the select tags of the drop-down (see below) to redirect the user, that one drop-down appears but none of the other text boxes or drop-downs.
<select id="RentOrOwn" name="RentOrOwn" id="RentOrOwn" onChange="RedirectToNewPage()">
<option selected="selected" value="">--Select--</option>
<option value=" rent my property</option>
<option value=" own my property</option>
</select>
<Script language="javascript">
<!--
function RedirectToNewPage(){
//get the select box object
var objSel=document.getElementById("RentOrOwn");
//redirect the user
document.location.href=objSel.options(objSel.selectedIndex).value;
}
//-->
</Script>
Thanks for your help.
Alexis
I tested just adding the function, which I put between the <head>/</head> tags, and none of the fields in the form appear. Once I add the Javascript call to the select tags of the drop-down (see below) to redirect the user, that one drop-down appears but none of the other text boxes or drop-downs.
<select id="RentOrOwn" name="RentOrOwn" id="RentOrOwn" onChange="RedirectToNewPage()">
<option selected="selected" value="">--Select--</option>
<option value=" rent my property</option>
<option value=" own my property</option>
</select>
<Script language="javascript">
<!--
function RedirectToNewPage(){
//get the select box object
var objSel=document.getElementById("RentOrOwn");
//redirect the user
document.location.href=objSel.options(objSel.selectedIndex).value;
}
//-->
</Script>
Thanks for your help.
Alexis