Here is my scenario,
IN my page i have a charity dropdown box,when user select any o开发者_JAVA百科ne of the dropdown ,the charity details should be shown in popup box,how to do that???
You should use jQuery to handle the event "onchange" and then complete the other inputs with data retrieved maybe after an Ajax request ?
Here is some kind of code you could use :
HTML Select input :
<select id="charity">
<option id="idtest">test</option>
<option id="idtest2">test2</option>
<option id="idtest3">test3</option>
<option id="idtest4">test4</option>
</select>
Javascript with jQuery :
$(function() {
$("#charity").change(function() {
var selectedOption ID = $("#charity option:selected").attr("id");
// Here is your ajax with jQuery too. Use the var "selectedOption" to know which option is selected
});
});
精彩评论