I have a input text box. I trigger a dialog when blur. Dialog has 2 buttons, one is "Yes" and another is "No". I need to blank the text box when I press "No" button . How can I do that??
I am attacing my code below. Where "#qty_fld" is the input text box.
- $("#qty_fld").live('blur',function()
{
var $dialog = $('<div></div>')
.html('<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>You are going to place an <b>Odd Lot</b> order. Are you sure?</p>')
.dialog(
{
resizable: false,
height:140,
modal: true,
show: "slide",
title:"Odd Lot Warning",
hide: "explode",
open: function(event, ui)
{
//hide close button.
$(this).parent().children().children('.ui-dialog-titlebar-close').hide();
},
buttons: {
"Yes": function()
{
$(this).dialog( "close" );
},
"No": function()
{
//$("#qty_fld").val == '';
value = $(this).parent().val;
alert(value);
//$( this ).dialog( "close" );
}
}
});
$dialog.dialog('open');
return false;
});