I am using jquery’s change() method in my code.
$("select,input,textarea").change(function ()
{
needToConfirm = true;
alert("needToConfirm :" + needToConfirm);
})
It’s working fine with all select, input as well as textarea element except for following textarea element
<textarea name="myTextArea" id="myTextArea" class="mceEditor" rows="4" cols="125">${myForm.someAttribute }</textarea>
I observed that other textarea don’t have any dynamic value while this myTextArea have ${myForm.someAttribute} value. This seems to be the cause but I am not able to figure out the exact reason.
Its working fine with following textarea element
<textarea path="studySummary" cssClass="fieldValue mediumFontSize" rows="4" cols="95" tabindex="67"/>
EDIT:
Hello All,
All things are working fine but I came across a new issue. I have some HTML elements like select,input etc which get added dynamically through javascript. How can I bind jquery’s change() method to this dynamically added elements ? Right now change() is only invoked for static elements.
EDIT2
Got the solution. Copy of this question.
I am assuming from the
class="mceEditor"that you are using the tinyMCE editor.This will replace the actual element, and so your code will not run on the new element.
Here is the proposed way on handling such a case http://tinymce.moxiecode.com/wiki.php/Configuration:onchange_callback
You basically have to put your change code in a function, and use that when initializing the tinyMCE.
and also when you call the tinyMCE initialization add the