By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

more submit buttons problem

P: n/a
I have a form with few text inputs. Every text input is followed by image type
input. In this form I want to have 1 submit button on the top. A problem I want
to resolve is: when user type something into text input and press enter then I
want to submit form by image type button but not by submit button. I tried to
use tabindex parameter but this not work as I expect.

Any idea?

Code example:
------------------------------------------------------------------------------------------
<form name="test" action="index.php" method="post">

<input type="submit" name="ok" value="Accept" tabindex=100>

<span>Item 1
<input type="text" name="i1" tabindex=1>
<input type="image" src="basket.gif" name="add1" tabindex=2>
</span>

<span>Item 2
<input type="text" name="i2" tabindex=3>
<input type="image" src="basket.gif" name="add2" tabindex=4>
</span>

<span>Item 3
<input type="text" name="i3" tabindex=5>
<input type="image" src="basket.gif" name="add3" tabindex=6>
</span>
</form>
------------------------------------------------------------------------------------------

--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>

Nov 6 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Petr Vileta (fidokomik) wrote:
I have a form with few text inputs. Every text input is followed by
image type input.
Image type inputs have poor usability, accessibility, robustness, and
maintainability properties. Otherwise they're excellent! :-)
In this form I want to have 1 submit button on the top.
One normal submit button per form is really the only robust approach.
Choices between alternatives need to be made by the user prior to submitting
the form, not by the way he submits it (e.g. which button is used). This is
not so by the specs but by the differences between implementations and gray
areas in specs.
A problem I want to resolve is: when user type something into
text input and press enter then I want to submit form by image type
button but not by submit button.
You need to redefine the problem. There is no way to achieve that in HTML,
and any JavaScript way would be unreliable (and probably tricky).
I tried to use tabindex parameter
but this not work as I expect.
Why did you expect to do anything except its defined meaning?
Any idea?
Any URL that explains the original problem or goal?
Code example:
Any URL?
<form name="test" action="index.php" method="post">

<input type="submit" name="ok" value="Accept" tabindex=100>
A submit button at the start of a form (that contains other fields as well)
is so uncommon that it is poor usability. Normally a submit button appears
at a place where the user is expected to submit the form.
<span>Item 1
<input type="text" name="i1" tabindex=1>
<input type="image" src="basket.gif" name="add1" tabindex=2>
</span>
That's illogical markup; <spanmeans nothing.

And you have no textual explanation of the meanings of fields, etc.

What do you need the image buttons for? You get a name/value pair from a
text input field - isn't that enough for processing?

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

Nov 6 '08 #2

P: n/a
Jukka K. Korpela wrote:
One normal submit button per form is really the only robust approach.
Choices between alternatives need to be made by the user prior to
submitting the form, not by the way he submits it (e.g. which button is
used).
There are pages where this is not the best approach. I have a page that
lists the 1000 or so files that I own on our server. It is laid out as a
table, with one file per row, and a string of submit buttons for the
functions available (make R/O, erase, etc).

If I converted to a list of selections (radio or checkbox) and a single
Submit button then the user would usually have to take four actions:
- Scroll to/Find the file
- Select the action
- Scroll to the Submit button
- Click the button

With my table, listing files, and bristling with buttons this is just
two actions:
- Scroll to/Find the file
- Click the action that you want

Being a man, and thus congenitally incapable of doing two things at a
time, I never feel the need to act on more than one file in each
transaction.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Nov 7 '08 #3

P: n/a
Swifty wrote:
I have a page
that lists the 1000 or so files that I own on our server.
That's a huge list, though in a simple situation, users might know how to
use their browser's Find function. However, usually it is better to divide
such a list into smaller pieces, and then you could have one page per piece,
perhaps with a search form for free text search among all files.
It is laid
out as a table, with one file per row, and a string of submit buttons
for the functions available (make R/O, erase, etc).
That might work well enough. My note about single submit button as the only
reliable approach had the implied assumption that there is at least one text
input field. In that case, you cannot really be sure what happens when a
user hits Enter in such a field.

In the absence of any other controls than submit buttons, they are
comparable to links and could in fact be replaced by links, possibly
violating the recommendation that GET method (which is what a link uses) be
only used for idempotent transactions.

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

Nov 7 '08 #4

P: n/a
Jukka K. Korpela wrote:
That might work well enough. My note about single submit button as the
only reliable approach had the implied assumption that there is at least
one text input field. In that case, you cannot really be sure what
happens when a user hits Enter in such a field.
Oh, don't I know that! I've fixed problems associated with users
pressing Enter instead of clicking the submit button at least three
times in the past month.
It seems to me that there is a new generation of users of my webpages,
that are far more likely to use the keyboard and ignore the mouse, and
they are finding problems with pages that have been stable for years.

I'll admit that it had never occurred to me to test my webpages for what
happens when "Enter" is used.

Fortunately, I enjoy fixing problems, and these are trivial to fix (I
just take the Name/Value from the submit button and put it in a HIDDEN
field, then remove the NAME= from the submit button). My users also
enjoy finding these problems, as I give a 5 Amazon voucher to the
person who finds the most bugs each month. :-) For a mere 5 each month,
I have an army of about 15,000 users busily testing all my pages for me.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Nov 8 '08 #5

P: n/a
Petr Vileta (fidokomik) wrote:
>You should have posted a URL in the first place.
I can't because I'm building shop for production (live) web and shop
must not be accesible for visitors until will be completed.
You can always compose a publicly demonstrable version of what you are
doing, if your question is on-topic here. If it's too much trouble to you in
your opinion, then it's probably best to save _everyone's_ time and not post
the question at all.
For this
reason and because form is generated by huge php script I can't to
post URL.
You can always save and upload the document generated by your "huge php
script" or whatever.
The problem definition is simple I think.
That's because you haven't though of it well enough.
I have an experience that ugly web shop do not sell good good, but
nice web sell any trash (junk?) :-)
I know that web shops that don't work sell less than those that do work.
My shop use the same strategy and for thsi reason I need Cancel
button. But this is not type=reset ;-)
You haven't described what your "Cancel button" is (and you refused to post
a URL), so it was fair to assume that it means what it normally means. And
if it is for removing items from a shopping basket, "Cancel" is a wrong
word.
>I knew that, but you misinterpret the implications. You can simply
put one pair of controls (quantity selection and submit button) in
one form.
I have say 5 items per page. If I understand you right meant you to
create 5 forms?
Bingo!

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

Nov 9 '08 #6

P: n/a
Petr Vileta (fidokomik) wrote:
I can't because I'm building shop for production (live) web and shop
must not be accesible for visitors until will be completed. For this
reason and because form is generated by huge php script I can't to post
URL.
This doesn't address your stated problem, but if I read what you are
saying about why you can't post a URL, here are some thoughts.

I frequently have to get an html version of a generated page, PHP
generated , python generated, whatever. It is a simple matter of going
to the URL (production site or development site) that generates the
page, then simply save page as whatever.html If it is a page that a
client must approve prior to being published, I simply publish it in a
subdirectory known only to the client, like example.com/review/test.html
Of course I don't leave it there very long, so it doesn't get crawled
by search engine spiders.

Bill
Nov 10 '08 #7

P: n/a
William Gill wrote:
Petr Vileta (fidokomik) wrote:
>I can't because I'm building shop for production (live) web and shop
must not be accesible for visitors until will be completed. For this
reason and because form is generated by huge php script I can't to
post URL.

I frequently have to get an html version of a generated page, PHP
generated , python generated, whatever.
[.. .]
Bill
Of course, but thit way can not show a problem exactly because when you press
any button you will not see what happen. When I use this way then I must write a
simple php or cgi script to show result after form submit.
But during few days I write some demo and publish it inmy test server. I let to
know here.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>

Nov 10 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.