I want to view the jquery/javascript dialog box when a perticular textbox is empty..I tried below code but doesnt work..how do I add if() function to below code?
<script>
$(document).ready(function () {
$('#search_btn').click(function () {
if ($('#form1.legacy_code_text.value') == "") { /// THIS DOESNT WORK I WANT THE CORRECT WAY FOR THIS LINE
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Ok": function () {
$('#form1').submit();
//*****************************************************************
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
});
});
</script>
1 Answer