Steve February 2016

How do I add a select button to this list please?

How do I change this list from a drop down list that automatically changes to the URL in the drop down field, to a drop down list where the user has to select a green "select" button?

Thank you, Steve.

<select name="cars" id="dynamic_select">
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Borrowing-Power-Calculator.aspx?ID=MFAA">Borrowing Power Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Loan-Repayment-Calculator.aspx?ID=MFAA">Loan Repayment Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Lump-Sum-Repayment-Calculator.aspx?ID=MFAA">Lump Sum Repayment Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Extra_Repayment_Calculator.aspx?ID=MFAA">Extra Repayment Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Budget-Planner.aspx?ID=MFAA">Budget Planner</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Loan-Comparison-Calculator.aspx?ID=MFAA">Loan Comparison Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/How-Long-to-Repay-Calculator.aspx?ID=MFAA">How Long to Repay Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Split-Loan-Calculator.aspx?ID=MFAA">Split Loan Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Property-Selling-Cost-Calculator.aspx?ID=MFAA">Property Selling Cost Calculator</option>
  <option value="http://www.visionabacus.com/Finance/Australia/1/SuiteA100/640/Property-Buying-Cost-Calculator.aspx?ID=MFAA">Property Buying Cost Calculator</option>
  <option value="http://www.visionabacus.com/        

Answers


jiff February 2016

Check this out:

<select name="cars" id="dynamic_select">
  <option value="https://google.com">google.com</option>
  <option value="https://google.de">google.de</option>
</select>

JS:

  $('#dynamic_select').on('change', function () {
      var url = $(this).val();
        window.location = url; 
  });

Update:

 $('#Submit').on('click', function () {
      var url = $('#dynamic_select').val();
        window.location = url;
        alert(url); // remove this line later
  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select name="cars" id="dynamic_select">
  <option value="https://google.com">google.com</option>
  <option value="https://google.de">google.de</option>
</select>
<input id="Submit" value="Go" type="submit"/>

Post Status

Asked in February 2016
Viewed 3,910 times
Voted 8
Answered 1 times

Search




Leave an answer