if a ui dialog with a form is opened again (no page refresh), the .live() elements do not respond
The first time a dialog is opened with a form, a button that changes a dropdown to a text field when "Other" is selected works fine. If the dialog is closed and then opened again, the .live('change',function()) script doesn't work properly.
The script is activated, when I insert an alert() into the script at the right point (insert alert after line 9 below), the alert appears, but the script does not complete. The elements are there and correct. Very strange.
- $('#poOrderMethod').livequery('mouseup',
- function(event){
- showOtherField('poOrderMethod', 'orderMethodView');
- }// end function(event)
- );// end live('change',kVendor);
- function showOtherField(sourceId, targetSpan, fieldSize) {
- var myValue = $("#" + sourceId).val();
- if(myValue == "other") {
- $('#' + targetSpan).html("<input type='text' name='" + sourceId + "' id='" + sourceId + "'/>");
- $("#" + sourceId).focus();
- }
- }
Thanks for any assistance.