Hi, I need help please.
I have a javascript function within a xslt file.
On my dev tool, I have a WebTextEdit box with the properties & events. on the KeyPress event i want to add the javascript function IsNumeric().
var edit = igedit_getById("FG2100RefNo"); IsNumeric(edit);
but i get the the error: can't eval.
Please Assist, Regards!
Hi, You to kind and Thank You.
The problem i have is that, i'm usind a development tool that has the onkey event, with a property where i can insert code.
like: var edit = igedit_getById("FG2100RefNo"); IsNumeric(edit);
but no place for me to create the javascript function isNumeric.
Regards
Hello,
Sorry if this sounds confusing - it is just how our CSOM (client side object model works). For your convenience I have created a complete working sample of WebTextEdit not accepting anything but numbers:
<script type="text/javascript"> function keyPress(oEdit, charCode, oEvent) { // ignore the "0" character if (charCode > 31 && (charCode < 48 || charCode > 57)) oEvent.cancel = true; } </script> <igtxt:WebTextEdit ID="WebTextEdit1" runat="server"> <ClientSideEvents KeyPress="keyPress" /> </igtxt:WebTextEdit>
Totally Lost, i don't know this at all.
Well, yes, typically Javascript should not be in the XSLT (although it can be) - be then again, it really depends on your scenario.
As far as attaching event directly on the element of the WebTextEdit - yes, this is possible, however you need to use the <input> element of the editor, which can be obtain using the "elem" property of the editor client-side object.
For more information, please check out the following CSOM help article (and especially the "elem" help topic)
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebTextEdit_Object_CSOM.html
Hi, I need to execute an entire javascript function.
Found what i was doing wrong: var edit = igedit_getById("FG2100RefNo");var editText = edit.getText();alert(!isNaN(editText));But this only checks & displays a message box.
I need to execute the below BLOCKED SCRIPT
<SCRIPT language=Javascript> <!-- function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } //--> </SCRIPT> onkeypress="return isNumberKey(event)"
How do i do this with the webtextedit:
var edit = igedit_getById("FG2100RefNo");var editText = edit.getText(); function isNumberKey(evt){var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;return true;} return isNumberKey(editText)
I only have the onkey event property value to insert the code!
Please Assist