Re: Submit not working when Enter key is pressed

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Deepak Dembla (deepak.m_at_net-kraft.com)
Date: 06/14/04


Date: Mon, 14 Jun 2004 10:25:58 +0530

Hi Dave,

      Thank you for your reply. I will visit up the link you have sent and
go through further details.

And yes, about the TR's and TD's, I'll keep that in mind. Thankx again.

Regards,
Deepak

"Dave Anderson" <GTSPXOESSGOQ@spammotel.com> wrote in message
news:#X2ul57TEHA.204@TK2MSFTNGP10.phx.gbl...
> Please distill your posts to the relevant bits. If TABLE, TR and TD are
not
> part of the problem, try not to litter your message with them. Onward:
>
> Deepak Dembla wrote:
> >
> > <form name=subscribe method=post action=subpost.jsp>
> > ...<input type="text" name="Name">...
> > ...<input type="text" name="EmailAddress">...
> > ...<input type="image" src="submit.gif" name="submit">...
> >
> > I use the same page for subscribe and unsucscribe of emails.
> >
> > When the condition is for Subscribe both the text fields (name and
> > EmailAddress) get displayed. On pressing enter the form also gets
> > submitted.
> >
> > But if it is an email unsubscribe, only one text field i.e.
> > EmailAddres is displayed. Mouse click on the image button submits the
> > form but, on pressing the Enter key, it just refresh's the page (does
> > not submit the form).
>
> Ignoring for a moment your unfortunate choice of input names ("submit" is
in
> the form's namespace as a method), I would focus on your "subpost.jsp"
> server-side script. What you interpret as a refresh may, in fact, be a
post
> which fails to meet any of your processing conditions.
>
> With that in mind, you might want to focus on what is different about the
> request when you hit [Enter] rather than click the image input. Start by
> reading the W3C recommendation for the image input:
> http://www.w3.org/TR/html401/interact/forms.html#h-17.4.1
>
> In particular, note this passage:
>
> "When a pointing device is used to click on the image, the form is
> submitted and the click coordinates passed to the server. The x
> value is measured in pixels from the left of the image, and the y
> value in pixels from the top of the image. The submitted data
> includes name.x=x-value and name.y=y-value where "name" is the
> value of the name attribute, and x-value and y-value are the x and
> y coordinate values, respectively."
>
> Conspicuous by its absence is the desired behavior when the input is not
> clicked. If there are no other SUBMIT or IMAGE inputs in the form, most
> browsers will send name.x=0 and name.y=0 (in your case, submit.x and
> submit.y). But there is no requirement to do so. If your script requires a
> nonzero value (be mindful that some languages, such as JScript, implicitly
> convert numeric zero to boolean false), then your logic will need to be
> adjusted accordingly.
>
> Absent your server-side code, it is difficult to be more detailed.
>
>
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message.
Use
> of this email address implies consent to these terms. Please do not
contact
> me directly or ask me to contact you directly for assistance. If your
> question is worth asking, it's worth posting.
>
>



Relevant Pages

  • Re: Submit not working when Enter key is pressed
    ... Please distill your posts to the relevant bits. ... request when you hit rather than click the image input. ... Absent your server-side code, it is difficult to be more detailed. ... If your question is worth asking, ...
    (microsoft.public.scripting.jscript)
  • Re: Leftover questions for Tony P.
    ... IMO these posts are too long. ... Do you not accuse me of dishonesty? ... your state of mind notwithstanding. ... doing the same thing you accuse me of doing. ...
    (talk.origins)
  • Re: Leftover questions for Tony P.
    ... that is evidence I believe it makes some kind of ... You stated that Suzanne was being patronizing. ... conclusion without guessing at her state of mind. ... then I believe that you think your posts make a difference. ...
    (talk.origins)
  • Re: OT: Back when tv kicked ass
    ... LOL! ... can read your trolling and "fighting". ... You're trying to convince yourself that you're mind ... As opposed to your posts that scream "I'm lonely. ...
    (rec.music.artists.kiss)
  • Re: Theory Versus Composition Part One
    ... it is hard to separate completely who said what in my mind ... communicate and I will work to keep your posts straight and of course ... Critics here equate to many music theorists. ...
    (rec.music.theory)