0

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

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by ko ko
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.