Hi all,
i want to make a search page, there will be a dropdown box and a button for each result, i want to name the drop down boxes accordingly in such a way that i can use in the javascript code, i'm trying this way
<select name="hh[]">
<option>b</option>
<option>bb</option>
<option>bbb</option>
</select>
<input type="button" name="button" value="go" onClick="sky('1')">
but the problem is in javascript its giving an error
function sky(p) {
var myForm = document.createElement("form");
myForm.method="get" ;
myForm.action = "go.php";
var w = document.myform.mylist.selectedIndex;
var selected_text = document.myform.hh[p].options[w].text; (here is the problem)
var myInput = document.createElement("input") ;
myInput.setAttribute("name", "syllabus") ;
myInput.setAttribute("value", w);
myForm.appendChild(myInput) ;
document.body.appendChild(myForm) ;
myForm.submit() ;
document.body.removeChild(myForm) ;
}
any help will be greatly appreciated
regards