combo boxes

Results 1 to 2 of 2

Thread: combo boxes

  1. #1
    Join Date
    Dec 1969
    Posts
    7

    Default combo boxes

    Is there a way to have a user select something in a combo box and then pass that variable to another page without hitting a submit button? The combo box is not in a form...<BR><BR>Thanks

  2. #2
    Jason Miller Guest

    Default RE: combo boxes

    If you&#039re referring to the &#060;select&#062; boxes, try this JavaScript bit...<BR><BR>Got your select thing looking kind of like:<BR>&#060;form name="navigator"&#062;<BR>&#060;select name="show" size=1 onChange="navigate(this.form)"&#062;<BR>(the onChange is the only really important bit currently, but it is in a form so JavaScript knows where to find it)<BR><BR>Then a piece of JavaScript looking like:<BR><BR>&#060;script language="JavaScript"&#062;<BR>&#060;!-- Begin<BR>function navigate(form) {<BR> var myindex=form.show.selectedIndex<BR> window.location=("secondary.url.html?variable=" + form.show.options[myindex].value);<BR> }<BR>// End --&#062;<BR>&#060;/script&#062;<BR><BR>Note that my JS is really fairly rusty; the original which I use on my personal webheap just grabs the selected value for the URL, it doesn&#039t append it as a variable to a URL.<BR><BR>Hope that helps,<BR>--Jason<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •