javascript - Address of the page depending on the value -


I have a serious problem. I want to add two fields to this form "male" and "female" and give them different addresses I want to assign, for example "woman" for http: //female.com and for men "htp: //male.com" So if you choose "Category 1" and check the field "feminine" you will be redirected to the "htp: //female.com/Category1" page and if you check the "Male" and "Category 1" field You will be redirected to the page "htp: //male.com/Category1"

  function open () {var url = document.redirect.selection.value document.location.href = Url} & lt; Form name = "redirect" & gt; & Lt; Select Name = "Selection" & gt; & Lt; Option value = "/ category1" & gt; Category 1 & lt; / Options & gt; & Lt; Option value = "/ category2" & gt; Category 2 & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = button value = "go!" OnClick = "Open ();" & Gt; & Lt; / Form & gt;  

Try it out

 < Code> $ ('Selection'). Change (function () {location = this.options [this.selectedIndex] .value;})    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -