开发者

how to make popup box based on dropdown list selection using jquery

开发者 https://www.devze.com 2022-12-26 15:41 出处:网络
I have three colu开发者_如何学Cmns in the jquery grid with all three column has dropdown list boxes.

I have three colu开发者_如何学Cmns in the jquery grid with all three column has dropdown list boxes.

if you select first dropdown list box any value i need to enable second one. if you select second I need to enable third one using jquery.


one of the coolest things about jquery is its ability to handle events in the DOM.

the event you're looking for is .change() http://api.jquery.com/change/

the html markup for 2 select elements

<select id="first_select">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
</select>
<select id="second_select" disabled="disabled">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
</select>

javascript/jquery to handle changes to the select boxes

$("#first_select").change(function() {
  $("#second_select").removeAttr('disabled');
});

The second select element will be enabled when a change is made to the first. Follow this logic for the third select.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号