Response title
This is preview!




function for displaying some html content inside a jqueryui dilaog:function ui_window(title, dialogWidth, content,buttons,className)
{
$('<div id="window">').html(content).
dialog({
title: title,
show: 'drop',
hide: 'drop',
width: dialogWidth,
buttons: buttons,
close: function (ev, ui) { $(this).remove(); },
position: { my: 'center', at: 'center', of: window }
}
).addClass(className);
return false;
}function that calls the above function:function checkForValidCommand()
{
var content = getInnerHTML("#checkForValidCommand");
var myFunc = function ()
{
var pensionerID = $('#txtID').val();
alert(pensionerID);
$(this).dialog('destroy');
}
else
$('#txtID').focus();
}
var buttons = [{ text: 'OK', click: myFunc}];
ui_window("Pensioner", 410, content, buttons);
}checkForValidCommand" for the first time and input a value into the onlytextbox and press OK I get an alert with the value of the textbox. And then when I call thefunction again and press OK without enetering anything into the textbox I still get the alert with the old value. What is the problem in my code?<table>
<tr>
<td align="right">
<label>
Insert the pensioiner's ID:
</label>
</td>
<td>
<input id="txtID" type="text" onkeydown="return onlyNumbers(event);" maxlength="8"/>
</td>
</tr>
</table>© 2012 jQuery Foundation
Sponsored by
and others.
