how to open model popup on textbox click
I want to open modelpopup only when my checkbox is checked and user clicks on textbox.but how to find checkbox in this
for this i wrote,
<script type="text/javascript" language="javascript">
$(function() {
$("#x").dialog({
autoOpen: false,
height: 200,
width: 500,
modal: true
});
$("#y").click(function() {
$("#x").dialog("open");
retur开发者_运维技巧n false;
});
});
</script>
where x->id which should be opened in popup y->textbox id
You can locate your check box from its id
attribute and use the :checked selector to determine if it is checked:
$(function() {
$("#x").dialog({
autoOpen: false,
height: 200,
width: 500,
modal: true
});
$("#y").click(function() {
if ($("#yourCheckBoxId").is(":checked")) {
$("#x").dialog("open");
}
});
});
精彩评论