how to make popup box based on dropdown list selection using jquery
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.
精彩评论