当特定文本框为空时,我想查看 jquery/javascript 对话框。我尝试了下面的代码,但没有用。如何将 if() 函数添加到下面的代码中?
<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>