Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > bizarre event/function callback

Reply
Thread Tools

bizarre event/function callback

 
 
tattslotto1@hotmail.com
Guest
Posts: n/a
 
      11-10-2003
Hi,

I'm am newbie trying to learn javascript/forms/php and I've
encountered this problem under gecko based browsers (mozilla, ns7).

basically I have this page which contains a form which is partly
generated by php code.

the form code is

<form onsubmit="return savedata();" name="frmLoc" method="POST"
enctype="multipart/form-data"
action="/locations.php">

The following is php generated with 41 being the record id:

<input type="image" align="middle" alt="Delete this record"
src="images/cancel.gif" onclick="return verifyDelete('41');">

and at the end of the form code I have


<input type="text" tabindex=1 name="txtLocation">

Now the problem is that when I press Enter at the txtLocation field,
on gecko browsers, I get the verifyDelete function called as if I have
clicked on the input image control. The strange thing is that it is
always the event for the first record that is being launched.

This doesnt happen under ie6 or Konqueror. The javascript console does
not show any messages at all.

Any ideas what I am doing wrong?

Thanks

T.
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-10-2003


http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I'm am newbie trying to learn javascript/forms/php and I've
> encountered this problem under gecko based browsers (mozilla, ns7).
>
> basically I have this page which contains a form which is partly
> generated by php code.
>
> the form code is
>
> <form onsubmit="return savedata();" name="frmLoc" method="POST"
> enctype="multipart/form-data"
> action="/locations.php">
>
> The following is php generated with 41 being the record id:
>
> <input type="image" align="middle" alt="Delete this record"
> src="images/cancel.gif" onclick="return verifyDelete('41');">
>
> and at the end of the form code I have
>
>
> <input type="text" tabindex=1 name="txtLocation">
>
> Now the problem is that when I press Enter at the txtLocation field,
> on gecko browsers, I get the verifyDelete function called as if I have
> clicked on the input image control. The strange thing is that it is
> always the event for the first record that is being launched.
>
> This doesnt happen under ie6 or Konqueror. The javascript console does
> not show any messages at all.
>
> Any ideas what I am doing wrong?


I think you have run into a bug with Mozilla, I have filed
http://bugzilla.mozilla.org/show_bug.cgi?id=225214
Opera 7 exhibits a similar behaviour however.

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
tattslotto1@hotmail.com
Guest
Posts: n/a
 
      11-11-2003
Martin Honnen <(E-Mail Removed)> wrote in message news:<3faf84cc$(E-Mail Removed)>...
> (E-Mail Removed) wrote:
> > I'm am newbie trying to learn javascript/forms/php and I've
> > encountered this problem under gecko based browsers (mozilla, ns7).
> >
> > basically I have this page which contains a form which is partly
> > generated by php code.
> >
> > the form code is
> >
> > <form onsubmit="return savedata();" name="frmLoc" method="POST"
> > enctype="multipart/form-data"
> > action="/locations.php">
> >
> > The following is php generated with 41 being the record id:
> >
> > <input type="image" align="middle" alt="Delete this record"
> > src="images/cancel.gif" onclick="return verifyDelete('41');">
> >
> > and at the end of the form code I have
> >
> >
> > <input type="text" tabindex=1 name="txtLocation">
> >
> > Now the problem is that when I press Enter at the txtLocation field,
> > on gecko browsers, I get the verifyDelete function called as if I have
> > clicked on the input image control. The strange thing is that it is
> > always the event for the first record that is being launched.
> >
> > This doesnt happen under ie6 or Konqueror. The javascript console does
> > not show any messages at all.
> >
> > Any ideas what I am doing wrong?

>
> I think you have run into a bug with Mozilla, I have filed
> http://bugzilla.mozilla.org/show_bug.cgi?id=225214
> Opera 7 exhibits a similar behaviour however.


Thanks Martin. I was pulling my hair out trying to figure it out

The bug status is currently set to resolved. The recommended solution
is that I replace <input type="text" name="inputName" tabindex="1">
with
<input type="submit" name="inputName" tabindex="1">

I already have a submit button. I dont need a second.

Cheers,

T.
 
Reply With Quote
 
tattslotto1@hotmail.com
Guest
Posts: n/a
 
      11-11-2003
(E-Mail Removed) wrote in message news:<(E-Mail Removed). com>...
> Martin Honnen <(E-Mail Removed)> wrote in message news:<3faf84cc$(E-Mail Removed)>...
> > (E-Mail Removed) wrote:
> > > I'm am newbie trying to learn javascript/forms/php and I've
> > > encountered this problem under gecko based browsers (mozilla, ns7).
> > >
> > > basically I have this page which contains a form which is partly
> > > generated by php code.
> > >
> > > the form code is
> > >
> > > <form onsubmit="return savedata();" name="frmLoc" method="POST"
> > > enctype="multipart/form-data"
> > > action="/locations.php">
> > >
> > > The following is php generated with 41 being the record id:
> > >
> > > <input type="image" align="middle" alt="Delete this record"
> > > src="images/cancel.gif" onclick="return verifyDelete('41');">
> > >
> > > and at the end of the form code I have
> > >
> > >
> > > <input type="text" tabindex=1 name="txtLocation">
> > >
> > > Now the problem is that when I press Enter at the txtLocation field,
> > > on gecko browsers, I get the verifyDelete function called as if I have
> > > clicked on the input image control. The strange thing is that it is
> > > always the event for the first record that is being launched.
> > >
> > > This doesnt happen under ie6 or Konqueror. The javascript console does
> > > not show any messages at all.
> > >
> > > Any ideas what I am doing wrong?

> >
> > I think you have run into a bug with Mozilla, I have filed
> > http://bugzilla.mozilla.org/show_bug.cgi?id=225214
> > Opera 7 exhibits a similar behaviour however.

>
> Thanks Martin. I was pulling my hair out trying to figure it out
>
> The bug status is currently set to resolved. The recommended solution
> is that I replace <input type="text" name="inputName" tabindex="1">
> with
> <input type="submit" name="inputName" tabindex="1">
>
> I already have a submit button. I dont need a second.
>
> Cheers,
>
> T.


Read the related bugs reports and comments and seems like this is the
'expected' behaviour for gecko browsers. I changed the

<input type="image"

to

<img ... onclick="

and all is well.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bizarre behavior by FireFox 1.0.7 Gerald Orvis Davis Firefox 2 11-07-2005 07:53 AM
Bizarre 2621 Router Problem Frank Durham Cisco 2 03-23-2005 02:52 PM
Bizarre switching problem Matthew Melbourne Cisco 0 10-22-2004 07:25 PM
Bizarre 7960 SIP phone intermittent connectivity issues Grafton Corruption Cisco 1 09-27-2004 07:40 PM
Cisco 837 bizarre behavior Kapamarou Cisco 2 01-05-2004 10:31 AM



Advertisments