Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Focus and priorities in forms

Reply
Thread Tools

Focus and priorities in forms

 
 
Matthias Braun
Guest
Posts: n/a
 
      02-16-2010
Hi,

I have a form using two submit buttons:

<form action ...

<input type="submit" value="Cancel" name="UserPasswordCancel" />
<input type="submit" value="Submit" name="UserPasswordSubmit" />
....
</form>

Works fine! Now, if I type in the entries and hit just ENTER, the first
submit will be execute (UserPasswordCancel). How can I modify my page so
that the second button has the "focus" (UserPasswordSubmit)?

Thanks,

Mattihas
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      02-16-2010

"Matthias Braun" <(E-Mail Removed)> wrote in message
news:4b7a3d34$0$7618$(E-Mail Removed)-online.net...
> Hi,
>
> I have a form using two submit buttons:
>
> <form action ...
>
> <input type="submit" value="Cancel" name="UserPasswordCancel" />
> <input type="submit" value="Submit" name="UserPasswordSubmit" />
> ...
> </form>
>
> Works fine! Now, if I type in the entries and hit just ENTER, the first
> submit will be execute (UserPasswordCancel). How can I modify my page so
> that the second button has the "focus" (UserPasswordSubmit)?



<form action ...

<input type="submit" value="Submit" name="UserPasswordSubmit" />
<input type="submit" value="Cancel" name="UserPasswordCancel" />
....
</form>


 
Reply With Quote
 
 
 
 
Kiran Makam
Guest
Posts: n/a
 
      02-16-2010
> How can I modify my page so
> that the second button has the "focus" (UserPasswordSubmit)?


If 'Cancel' button is not submitting any thing, you can make it as a
normal button
-----
<input type="button" value="Cancel" name="UserPasswordCancel" />
----

- Kiran Makam

 
Reply With Quote
 
Doug Miller
Guest
Posts: n/a
 
      02-16-2010
In article <(E-Mail Removed)>, Kiran Makam <(E-Mail Removed)> wrote:
>> How can I modify my page so
>> that the second button has the "focus" (UserPasswordSubmit)?

>
>If 'Cancel' button is not submitting any thing, you can make it as a
>normal button
>-----
><input type="button" value="Cancel" name="UserPasswordCancel" />
>----


Or a reset button:
<input type="reset" value="Cancel" name="UserPasswordCancel" />
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-16-2010
Matthias Braun wrote:

> I have a form using two submit buttons:


Consider rethinking or redesigning.

> <form action ...
>
> <input type="submit" value="Cancel" name="UserPasswordCancel" />
> <input type="submit" value="Submit" name="UserPasswordSubmit" />
> ...
> </form>
>
> Works fine!


No it doesn't, as your question indicates. It's confusing and pointless.
Just omit the "Cancel" button. If someone doesn't want to log in, he just
won't. No need to click on any button for that. And don't replace it by a
destruct data button, called "reset" button - in a very simple form that
takes little user input, it does not cause great damage, but neither does it
do any good. It's just an annoyance and a pointless risk: when the user
accidentally hits it, he causes something he didn't mean.

> Now, if I type in the entries and hit just ENTER, the
> first submit will be execute (UserPasswordCancel).


Maybe. Perhaps even commonly. This is one of the reasons why your page does
not work fine.

> How can I modify
> my page so that the second button has the "focus"
> (UserPasswordSubmit)?


You can't, in any reliable way. And it's not a matter of focus at all.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Matthias Braun
Guest
Posts: n/a
 
      02-17-2010
Thanks - if there is no other option I will remove the cancel button.
Somehow a gap in HTML specification.

Cheers,

Matthias

Jukka K. Korpela wrote:
> Matthias Braun wrote:
>
>> I have a form using two submit buttons:

>
> Consider rethinking or redesigning.
>
>> <form action ...
>>
>> <input type="submit" value="Cancel" name="UserPasswordCancel" />
>> <input type="submit" value="Submit" name="UserPasswordSubmit" />
>> ...
>> </form>
>>
>> Works fine!

>
> No it doesn't, as your question indicates. It's confusing and pointless.
> Just omit the "Cancel" button. If someone doesn't want to log in, he
> just won't. No need to click on any button for that. And don't replace
> it by a destruct data button, called "reset" button - in a very simple
> form that takes little user input, it does not cause great damage, but
> neither does it do any good. It's just an annoyance and a pointless
> risk: when the user accidentally hits it, he causes something he didn't
> mean.
>
>> Now, if I type in the entries and hit just ENTER, the
>> first submit will be execute (UserPasswordCancel).

>
> Maybe. Perhaps even commonly. This is one of the reasons why your page
> does not work fine.
>
>> How can I modify
>> my page so that the second button has the "focus"
>> (UserPasswordSubmit)?

>
> You can't, in any reliable way. And it's not a matter of focus at all.
>

 
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
Collisions & priorities: xmlHttpRequest and setInterval RgeeK Javascript 5 07-12-2008 12:50 PM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
SwingWorker and inherited thread priorities Sebastian Millies Java 5 09-12-2005 04:40 PM
Network connection priorities =?Utf-8?B?SnVhbiBBbnRvbmlv?= Wireless Networking 2 07-04-2005 11:30 PM
Can you configure different priorities with syslog Phil Cisco 1 05-22-2004 06:00 AM



Advertisments