Join WhatsApp ChannelJoin Now

Select Option Redirect URL On Submit Using Javascript

Hi Dev,

Today, i we will show you select option redirect url on submit example. This article will give you simple example of select option redirect url on submit example. you will select option redirect url on submit example. In this article, we will implement a select option redirect url on submit example.

So let’s follow few step to create example of select option redirect url on submit example.

Example

<html>
   <head>
      <title>Select Option Redirect URL On Submit Example</title>
      <style>
         input, select
         {
         width: 280px;
         margin: 19px;
         height: 45 px;
         padding: 10px;
         }
      </style>
   </head>
   <body>
      <form  id="comment-form1" name="contact-form1"  onsubmit="return mysubmit();">
         <select  id="option" class="chosen" >
            <option selected disabled>Select Bank</option>
            <option value="https://codeplaners.com/">Sanwebcorner Demo</option>
            <option value="https://mbrwebsolution.com/" >Sanwebcorner Main Page</option>
            <option value="https://mbrwebsolution.com/contact-us" >Single page</option>
         </select>
         <br/>
         <input name="submit" type="submit" value="Submit" /><br>
      </form>
      <script>
         document.getElementById('comment-form1').addEventListener('submit',(e)=>{
          e.preventDefault();
          window.location = (document.getElementById('option').value);
         })
      </script>
      </div>
      </div>
      </section>
   </body>
</html>

I hope it will assist you…

Recommended Posts