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

What errors do you get ? I wanna mention that this forum is PHP forum and your thread beseem with Javascript forum. Move your thread to the Javascript forum or start a new thread in Javascript forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.