473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

more submit buttons problem

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
7 1913
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Colin Steadman | last post by:
I have two buttons on my form and need to know which was clicked. If I setup the buttons like this: <input type="submit" value="submit" name="submit_to_array"> <input type="submit"...
4
by: Bob Lehmann | last post by:
Hi, I pretty sure I've seen this problem addressed before, but I can't find any references. The short story is that I have I have multiple submit buttons on a page, each providing different...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
2
by: rudranee | last post by:
hello, How do i declare multiple submit buttons on a form? and how do i come to know on the next page which button has been clicked? Can i do it in JSP page? Please tell me.
5
by: Steve JORDI | last post by:
Just a question using images as submit buttons and PHP4.4.4. It seems that my code correctly works in FireFox but not in IExplorer. For example, I have a FORM with 2 buttons called "search" and...
2
by: sbettadpur | last post by:
Hi everybody, Hi iam strugling with more than one submit buttons with in one form here is my code <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">...
1
by: sbettadpur | last post by:
Hi everybody, Iam able to getting the submition of buttons status in Mozilla but it is not working in the IE browser Iam strugling with more than 1 submit button in a single form on The IE...
3
by: xtremebass | last post by:
Hi Bytes. i have 3 submit buttons namely click1,click2 and click3 . if i press the any of one submit button page submitted appropriate page correctly, But the problem is display the all...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.