bizarre event/function callback

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tattslotto1@hotmail.com

    bizarre event/function callback

    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="retur n savedata();" name="frmLoc" method="POST"
    enctype="multip art/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('4 1');">

    and at the end of the form code I have


    <input type="text" tabindex=1 name="txtLocati on">

    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.
  • tattslotto1@hotmail.com

    #2
    Re: bizarre event/function callback

    Martin Honnen <mahotrash@yaho o.de> wrote in message news:<3faf84cc$ 1@olaf.komtel.n et>...[color=blue]
    > tattslotto1@hot mail.com wrote:[color=green]
    > > 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="retur n savedata();" name="frmLoc" method="POST"
    > > enctype="multip art/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('4 1');">
    > >
    > > and at the end of the form code I have
    > >
    > >
    > > <input type="text" tabindex=1 name="txtLocati on">
    > >
    > > 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?[/color]
    >
    > 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.[/color]

    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.

    Comment

    • tattslotto1@hotmail.com

      #3
      Re: bizarre event/function callback

      tattslotto1@hot mail.com wrote in message news:<93c77f62. 0311101832.650f 647b@posting.go ogle.com>...[color=blue]
      > Martin Honnen <mahotrash@yaho o.de> wrote in message news:<3faf84cc$ 1@olaf.komtel.n et>...[color=green]
      > > tattslotto1@hot mail.com wrote:[color=darkred]
      > > > 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="retur n savedata();" name="frmLoc" method="POST"
      > > > enctype="multip art/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('4 1');">
      > > >
      > > > and at the end of the form code I have
      > > >
      > > >
      > > > <input type="text" tabindex=1 name="txtLocati on">
      > > >
      > > > 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?[/color]
      > >
      > > 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.[/color]
      >
      > 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.[/color]

      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.

      Comment

      Working...