T
teo
Hallo
Newbie question about syntax.
I'd like to fire the zzzzz event
when the user presses the 'Canc' key
on a Listbox item.
--------------------------------
I added:
onkeydown="javascript:zzzzz"
to the
<asp:ListBox
tag
but I got a green underscore
How can I avoid that green underscore?
If I ignore it, no problem seems to occur.
Does it really cause no problem?
--------
Also I added this:
<script language="javascript" type="text/javascript">
<!--
function zzzzz()
{
var i;
i= window.event.keyCode
if(i=46)
{
alert("Canc key is pressed");
this.form.mySubToCall()
this.form.Button1_Click()
}
}
// -->
</script>
the first event is regularly fired (alert),
but the second and the third ones are not fired,
and I got two error messages
(note: the Button1 is simply a control I placed on the form
and the mySubToCall is a simple Public Sub I manually wrote)
What have I to do in order to fire two events?
--------------------------
Also I'm wondering if
instead of
onkeydown="javascript:zzzzz"
I directly could call mySubToCall() and Button1_Click()
a sort of:
onkeydown="javascript:mySubToCall()"
and
onkeydown="javascript:Button1_Click()"
Newbie question about syntax.
I'd like to fire the zzzzz event
when the user presses the 'Canc' key
on a Listbox item.
--------------------------------
I added:
onkeydown="javascript:zzzzz"
to the
<asp:ListBox
tag
but I got a green underscore
How can I avoid that green underscore?
If I ignore it, no problem seems to occur.
Does it really cause no problem?
--------
Also I added this:
<script language="javascript" type="text/javascript">
<!--
function zzzzz()
{
var i;
i= window.event.keyCode
if(i=46)
{
alert("Canc key is pressed");
this.form.mySubToCall()
this.form.Button1_Click()
}
}
// -->
</script>
the first event is regularly fired (alert),
but the second and the third ones are not fired,
and I got two error messages
(note: the Button1 is simply a control I placed on the form
and the mySubToCall is a simple Public Sub I manually wrote)
What have I to do in order to fire two events?
--------------------------
Also I'm wondering if
instead of
onkeydown="javascript:zzzzz"
I directly could call mySubToCall() and Button1_Click()
a sort of:
onkeydown="javascript:mySubToCall()"
and
onkeydown="javascript:Button1_Click()"