form with to submits, which one to default to?

form with to submits, which one to default to?

am 04.12.2007 15:13:32 von jodleren

Hi

Say, I have a form.

Both cancel and save (in that order) are submits, then in the code I
check which button was pressed.
The point is that I want the save button (2nd) to be default, not the
cancel.

Is there a way (in js?) to "focus" the other button?

One other way to be some simple js, which submits the page anyway...

WBR
Sonnich

Re: form with to submits, which one to default to?

am 04.12.2007 15:27:41 von Jerry Stuckle

jodleren wrote:
> Hi
>
> Say, I have a form.
>
> Both cancel and save (in that order) are submits, then in the code I
> check which button was pressed.
> The point is that I want the save button (2nd) to be default, not the
> cancel.
>
> Is there a way (in js?) to "focus" the other button?
>
> One other way to be some simple js, which submits the page anyway...
>
> WBR
> Sonnich
>

Try a JS newsgroup. This one is for PHP - which can't do it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: form with to submits, which one to default to?

am 04.12.2007 15:28:27 von Michael Fesser

..oO(jodleren)

>Say, I have a form.
>
>Both cancel and save (in that order) are submits, then in the code I
>check which button was pressed.
>The point is that I want the save button (2nd) to be default, not the
>cancel.
>
>Is there a way (in js?) to "focus" the other button?

No. But why do you need a cancel button at all? Usually it's as useless
as a reset button.

>One other way to be some simple js, which submits the page anyway...

Even worse and unreliable.

Micha

Re: form with to submits, which one to default to?

am 04.12.2007 16:12:16 von Dikkie Dik

> Both cancel and save (in that order) are submits, then in the code I
> check which button was pressed.
> The point is that I want the save button (2nd) to be default, not the
> cancel.
>
> Is there a way (in js?) to "focus" the other button?


As a dirty hack, you could make the second button come first in the HTML
and flip it over with a stylesheet.

Good luck