javascript - change ajax url based on value of select option -


i have form select box 3 selections

<select id="tool" name="tool">     <option value="option1">option1</option>     <option value="option2">option2</option>     <option value="option3">option3</option> </select> 

each selection has own php file

  • option1.php
  • option2.php
  • option3.php

based on selection ajax url change respective php file

ajax part

$.ajax({     type: "get",     url: "option1.php", 

use jquery val() method

$.ajax({     type: "get",     url: $('#tool').val() + ".php", 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -