VBScript works, equivalent JScript doesn't - what am I missing?

This script is for DesktopX Edit object, basically it's suppose to respond to pressing Enter.
For some reason when I run this VB script, it works
Sub Control_OnKeyPress(Key)
' if enter key is pressed
If Key = 13 Then
Control.Text = "1234"
End If
End Sub


However, when I try to do the same thing with JScript, there's no response
function Control_OnKeyPress(Key)
{
if( Key == 13 )
{
Control.Text = "1234";
}
}


6,824 views 2 replies
Reply #1 Top
I have also found this, but with many functions.

I have had to resort to writing small amounts of VB in objects where I need such system level callbacks, including popup menus. THEN I have to do silly cross-object script calls to get in and out of javascript!

Very dissapointing
Reply #2 Top
Yea, I found some events not to trigger in JScript as well. OnSetFocus and OnKillFocus.

I'd suggest you put in a formal bug report to [email protected]. Direct to this thread as I expect more people to post issues as well.