Issue with Ajax, Jquery and PHP and Two Dropdown list

后端 未结 2 1172
粉色の甜心
粉色の甜心 2021-01-26 07:26

I am trying to populate second dropdown list based on first dropdown list selection using Ajax, jQuery,PHP and MySQL. the problem is the options in second dropdown list just app

相关标签:
2条回答
  • 2021-01-26 08:02

    You should edit your script into this..

    <select id="result">
      <option value="select">Please Select From The List</option>
    </select>
    
    0 讨论(0)
  • 2021-01-26 08:14

    You are setting $('#result').html(data); in the main file.

    result should be the id of the HTML select element, you used it as id for the an option element.

    (You are appending the values into the option element, which doesn't create new HTML elements, but they should be inserted into the select element.)

    0 讨论(0)
提交回复
热议问题