Twitter Facebook Google+ LinkedIn Pinterest Tumblr Reddit
Question

Assign url to select list

Tags:
Date:
Status:Resolved
Question Id:20

First of all, hello. I want to add a url to the following options, how can I get it to go to that URL when I press submit.

<form action="#" method="post" class="form">
    <select name="select" id="select" class="form__select" required>
      <option value="">Select something</option>
      <option value="01">Alfa</option>
      <option value="02">Bravo</option>
      <option value="03">Charlie</option>
      <option value="04">Delta</option>
      <option value="05">Echo</option>
      <option value="06">Foxtrot</option>
      <option value="07">Golf</option>
      <option value="08">Hotel</option>
      <option value="09">India</option>
      <option value="10">Juliett</option>
    </select>
      <input type="submit" value="Submit" class="form__submit" />

</form>
Answer
Date:
Correct:Yes

There are several methods, let me tell you the shortest way:

<select name="form">

<option value="mainpage.php">sirnode.com</option>

</select>

The other method is to find what has been selected in the select section, and the selected value with javascript: It is to route using window.location.

Answer
Date:
Correct:No

You must write the page you want to direct to the action part of the form.

Your Answer

Review Your Answer