Re: Submit not working when Enter key is pressed
From: Deepak Dembla (deepak.m_at_net-kraft.com)
Date: 06/14/04
- Next message: David C. Holley: "MOVED: Programatically setting form.action for Netscape?"
- Previous message: Jim M: "Keep-Together as part of <td> tag (Available for Printing)"
- In reply to: Dave Anderson: "Re: Submit not working when Enter key is pressed"
- Messages sorted by: [ date ] [ thread ]
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.
>
>
- Next message: David C. Holley: "MOVED: Programatically setting form.action for Netscape?"
- Previous message: Jim M: "Keep-Together as part of <td> tag (Available for Printing)"
- In reply to: Dave Anderson: "Re: Submit not working when Enter key is pressed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|