Hello, I found some script which allows me to
emulate "type down" functionality on a dropdown box in a vb.Net program.
When I load it into my project I get a message box pop up
which the script is loaded which says "Expected ")". It
looks well formed to me. Here is the function
function divert_entry()
{
obj = window.event.sr cElement;
//debugger;
if (obj.getAttribu te("persistValu e") == null)
obj.setAttribut e("persistValue ","");
var iKey;
var eAny_Event = window.event;
iKey = eAny_Event.keyC ode;
var sChr = String.fromChar Code(iKey);
if (iKey == 13)
{
obj.setAttribut e("persistValue ","");
return true;
}
if (iKey == 8)
{
sDelete_Chr = obj.getAttribut e("persistValue ");
obj.setAttribut e("persistValue ",
sDelete_Chr.sub string(0,sDelet e_Chr.length - 1));
sChr = '';
}
obj.setAttribut e
("persistValue" ,obj.getAttribu te("persistValu e") + sChr);
lookupItem(obj) ;
if (((iKey > 33 && iKey < 255) || (iKey
== 8)) && (iKey ! = 40) && (iKey != 38))
eAny_Event.retu rnValue = false;
}
What actually highlights in the error is the call to the
function which is loaded as follows:
drpNumbers.Attr ibutes.Add("onk eydown", "return divert_entry()" )
It highlights the "return divert_entry()"
Any ideas why?
..
emulate "type down" functionality on a dropdown box in a vb.Net program.
When I load it into my project I get a message box pop up
which the script is loaded which says "Expected ")". It
looks well formed to me. Here is the function
function divert_entry()
{
obj = window.event.sr cElement;
//debugger;
if (obj.getAttribu te("persistValu e") == null)
obj.setAttribut e("persistValue ","");
var iKey;
var eAny_Event = window.event;
iKey = eAny_Event.keyC ode;
var sChr = String.fromChar Code(iKey);
if (iKey == 13)
{
obj.setAttribut e("persistValue ","");
return true;
}
if (iKey == 8)
{
sDelete_Chr = obj.getAttribut e("persistValue ");
obj.setAttribut e("persistValue ",
sDelete_Chr.sub string(0,sDelet e_Chr.length - 1));
sChr = '';
}
obj.setAttribut e
("persistValue" ,obj.getAttribu te("persistValu e") + sChr);
lookupItem(obj) ;
if (((iKey > 33 && iKey < 255) || (iKey
== 8)) && (iKey ! = 40) && (iKey != 38))
eAny_Event.retu rnValue = false;
}
What actually highlights in the error is the call to the
function which is loaded as follows:
drpNumbers.Attr ibutes.Add("onk eydown", "return divert_entry()" )
It highlights the "return divert_entry()"
Any ideas why?
..
Comment