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
Post a Comment