Hi,
how to open a page using javascript by selecting an item in combobox.
If i choose an item in combo box

if (form.element.selectedIndex =="1"){
window.open("example.htm");
}

Thanks and any help would be appreciated.

    You should be able to make this do what you want with a little modification.

    <script language="Javascript">
      function my_function(argSelect) {
        alert('selected:' + argSelect.options[argSelect.selectedIndex].value);
      }
    </script>
    <select onChange="my_function(this)">
      <option value="page1.htm">First Choice</option>
      <option value="page2.htm">Second Choice</option>
      <option value="page3.htm">Third Choice</option>
    </select>
    

      Thanks a lot its working, but if i choose only yes, it should redirect to page1.htm.(Its working) but if i choose again No, it should remain in same page.
      The page url is /currentpage.php?update=value
      How i can do this.?.

      <select onChange="my_function(this)"> 
        <option value="" SELECTED>No</option> 
        <option value="page1.htm">Yes</option> 
      </select> 
      

      Thanks.

        check to see if the value = ""
        if it does, then do nothing.

          Hi,
          I checked with value = ""

          <select onChange="my_function(this)"> 
            <option value="" SELECTED>No</option> 
            <option value="page1.htm">Yes</option> 
          </select> 
          

          Its opening a page
          about:blank in url.
          I want to remain in the same page instead of opening a blank page.
          How can i do it. Any help will be appreciated.
          Thanks.

            Hi,
            I found out how to make it.It works,
            I used

            location.href(argSelect.options[argSelect.selectedIndex].value); 
            

            Thanks.

              Write a Reply...