472,807 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,807 software developers and data experts.

Highlight the <input type="submit"> object of my choice?

How can I highlight the <input type="submit"> object that I want to
highlight?

1. In my form, the user enters his ID. He sees two submit "buttons,"
left labeled Cancel, the right labeled Signup.

2. If he enters his ID and selects the Signup button with his mouse,
all is well.

3. But if he enters his ID and then hits the Enter key, then the
(highlighted) Cancel button is taken.

4. Obviously it needs to be the other way around: Enter key must take
the Signup path.

How can I highlight the Signup button when the user enters the form
such that when he strikes the Enter key, the action on that Signup
button is taken? I don't find the answer to precisely this question in
the FAQ.

The form that shows the problem is at:

http://www.pwilson.net/submit-demo.html

Problem appears in IE6.0, Avant 10.1, and Firefox 0.10.1 (no visual
highlighting cue in FF, but the effect is the same).

I see that right-clicking the mouse anywhere inside the table (green
border) that's inside the form (red border) highlights the Cancel
button. Clicking anywhere outside that table removes the highlighting.
I have tried a few things, like adjusting the layout so that the
Signup button is first in the character stream but is displayed on the
right. Also tried tabindex. None of that worked for me.

Thanks so much for your help!

-- Pete Wilson
Jul 23 '05 #1
3 7655
'cancel' button should be type=reset, not type=submit.. also, not sure
about this, but might help if yout put submit button on left, cancel
button on right.. HTH.. Frances
Pete Wilson wrote:
How can I highlight the <input type="submit"> object that I want to
highlight?

1. In my form, the user enters his ID. He sees two submit "buttons,"
left labeled Cancel, the right labeled Signup.

2. If he enters his ID and selects the Signup button with his mouse,
all is well.

3. But if he enters his ID and then hits the Enter key, then the
(highlighted) Cancel button is taken.

4. Obviously it needs to be the other way around: Enter key must take
the Signup path.

How can I highlight the Signup button when the user enters the form
such that when he strikes the Enter key, the action on that Signup
button is taken? I don't find the answer to precisely this question in
the FAQ.

The form that shows the problem is at:

http://www.pwilson.net/submit-demo.html

Problem appears in IE6.0, Avant 10.1, and Firefox 0.10.1 (no visual
highlighting cue in FF, but the effect is the same).

I see that right-clicking the mouse anywhere inside the table (green
border) that's inside the form (red border) highlights the Cancel
button. Clicking anywhere outside that table removes the highlighting.
I have tried a few things, like adjusting the layout so that the
Signup button is first in the character stream but is displayed on the
right. Also tried tabindex. None of that worked for me.

Thanks so much for your help!

-- Pete Wilson


Jul 23 '05 #2
Pete Wilson wrote:
How can I highlight the <input type="submit"> object that I want to
highlight?
With css, but from the rest of your post, I think you mean "how can I
put focus on a particular submit input", in which case the answer would
be javascript. Mind you, that may not change how the form works with
regard to key presses.
1. In my form, the user enters his ID. He sees two submit "buttons,"
left labeled Cancel, the right labeled Signup.
Why is there a cancel button? What does it do?
2. If he enters his ID and selects the Signup button with his mouse,
all is well.

3. But if he enters his ID and then hits the Enter key, then the
(highlighted) Cancel button is taken.

4. Obviously it needs to be the other way around: Enter key must take
the Signup path.

How can I highlight the Signup button when the user enters the form
such that when he strikes the Enter key, the action on that Signup
button is taken?


I don't think there's anything in the spec to decide which input
type="submit" button is activated by an <enter> keypress.

I'd advise rethinking the form. Lose the "cancel" button. If the user
doesn't want to submit a registration, they won't press the "signup"
button. Simple as that.

--
Brian (remove "invalid" to email me)
Jul 23 '05 #3
Frances wrote:
'cancel' button should be type=reset, not type=submit.. also, not sure
about this, but might help if yout put submit button on left, cancel
button on right.. HTH.. Frances
Sorry, I didn't explain it clearly and I'm sorry I chose the word "Cancel"
for the submit-button value. In this form, "Cancel" means: abandon this
process that I'm in the middle of, and do it right now. I don't want to
submit the form content, I want to forget about it all together. Get me
outta' here.

My cgi interprets the button press, though for simplicity I don't show
this in the example. So type=reset lacks the effect I'm looking for.

Brian wrote:
I think you mean "how can I
put focus on a particular submit input", in which case the answer would
be javascript. Mind you, that may not change how the form works with
regard to key presses.
That works great the first time into the form. But if I take the focus
out of the form (by hand) and then re-select at some place inside the
form, the focus again moves to the cancel button as before. Very curious
behavior. It works that way in several browsers. Not whining, just
telling my experience with that particular solution.
If the user
doesn't want to submit a registration, they won't press the "signup"
button. Simple as that.


Absolutely. But the user has to press /something/ to leave the page
and the close-by cancel button, as opposed to e.g. the browser's back
button, seems very convenient and intuitive.

Thank you both.

-- Pete Wilson
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
5
by: Mikko Rantalainen | last post by:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>. The problem is that the label of submit button is always centered on the button regardsless of 'text-align' property in CSS....
1
by: Jesper Hermansen | last post by:
Hi! I'm making a system that will generate Winamp-playlists. To make it easy for the user to add a file to the list, I'm using <input type="file">. The problem with this is that I only get...
2
by: Laermans_k | last post by:
Hi, Does anyone have a solution to use the <input type="file" id="filechooser"> and the <input type="submit" id="submitbutton"> in 1 button click? I've already tried to create a javascript...
2
by: Tarkeshwar | last post by:
Hi All, I want to restrict the user from being entering the value in <input type="file">. It works fine in IE but not in Mozilla. I am sending my code also which works in IE and not in Mozilla.Can...
1
by: mark4asp | last post by:
<form runat="server"automatically adds <divtag to code contained within. Is there a way to stop that? Mixing block-level elements with inline-level elements messes up the HTML becasuse that is...
1
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form...
1
by: ChollaPete | last post by:
This code: <form action="processScan.php" method="get"> <p> <?php print "Scan name: <input type=\"file\" name=\"tScanFileName\" value= \"{$scanFileName}\"><br>"; addHiddenCarryons(); ?>...
14
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post"...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.