Hi everyone,
I've got the following code;
Code:
$("td.printer").click(function() {
var printerId = $(this).attr('id');
var printerName = $(this).html();
// If there isn't already an input box open... make one
if (printerName.search(/input name=\"/) != 1) {
$(this).html('<input name="printer[' + printerId + ']" value="' + printerName + '" class="printer_name" />');
}
});
Which creates an input box on click with the printer name in it (for editing). However, the following code doesn't work...?
Code:
// When user unclicks the box
$("input.printer_name").blur(function() {
alert("poooo");
});
I know that if it's an AJAX request then you would put the additional code in a callback function. What do I do in this circumstance?
Thanks in advance
|