Hi, I urgently need help, please.
WebtextEdit ClientSideEvent execute javascript statement on mousemove event. I can successfully change the style of another object type on this WebTextEdit ClientSide MouseMove event:document.getElementById("Object2").style.backgroundColor = '#F0F5F7';
But when I want to change the style of the WebTextEdit control:document.getElementById("WebTextEdit1").style.backgroundColor = '#F0F5F7'; Then nothing happens
When I execute the script on the same WebTextEdit Clientside for another object which is not a WebtextEdit:Object2.style.border='1px solid #FFE6A0'; Then it works
But when I want to change the WebtextEdit Clientside style:WebTextEdit1.style.border='1px solid #FFE6A0';
Then I get Error: Can't Eval WebTextEdit1.style.border='1px solid #FFE6A0';
Please Help
Hi Viktor
Hi could I get the old text from the TextChanged event. I am talking about the ajax component "WebTextEditor" that only have two parameters. I mean, something similar to the non ajax webTextEdit component .
Any ideas
Many Thanks
Jorge from ANS
Hi Viktor.
How could i get the old value of the webTextEdito. For the webTextEdit is posible, but for the ajax component webTextEdioto I do not see any argument in order to retrieve the old value.
Any ideas??
Jorge from ApliedNetworkSolutions
That worked perfectly. Thank you very much for your help.
Hi David,
I reviewed your codes and noticed that you use Web.UI.WebTextEditor, but not WebUI.WebTextEdit.
The WebTextEditor uses client events model of its base AJAX. That includes only 2 params (similar to events of server). First param is sender which represents reference to WebTextEditor and second param is EventArgs. For KeyDown that is instance of Infragistics.Web.UI.TextEditorKeyEventArgs class. It has members get_cancel(), set_cancel(bool), get_browserEvent() and get_keyCode() members.You may add debugger; line in handler and check exact members of that param.
Ok. I tried that and my javascript function does get called. Here is what it looks like;
<script type="text/javascript" id="igClientScript"> function keyPressInEdit(oEdit, keyCode, oEvent) { var text = oEdit.get_value(); var ar = text.split(' ') if (ar.length >= 3) oEvent.cancel = true; }</script>
The problem is that oEvent is undefined. My code breaks at the oEvent.cancel line. oEdit and keyCode are defined so that is good. How do I cancel the keypress if oEvent is undefined?