472,968 Members | 1,515 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,968 software developers and data experts.

One form and two very different submits?

I seriously doubt this is possible...but you never know, so here goes.

Due to bad pre-planning I have a Web page that is VERY table heavy with
a very complicated and delicate setup. Any changes to the table
structure, as in size changes or additions of new cells, throws the
whole thing out of whack.

(Let me pause here to say I understand quite well that tables in
general are not a good idea anymore. Didn't know that until after I
built this page, and if I had time to rebuild from scratch, I would.
So, knowing already that tables are bad, CSS are good, I'm hoping I can
get some advice on the following question having that in mind.)

I need to have two forms on the page, one for a small search field and
one for a main form submission. Unfortunately any attempt to put one
form tag around the smaller search field throws the whole table
structure out of whak, so I'm forced to put the form tag around the
whole root, main table. Which means I can't use two tables.

So, is there a way to have two submit buttons that can can be forced to
submit the form to one "action" and the other to another "action"?

At worst what I can do is have one result page that checks to see if
one field is blank and if not, redirect to another page with all the
info in GET, but I really don't like that idea.

Any suggestions?
(ASIDE from "redo the page from scratch and do it right this time." I
know I know. If all you're going to do is berate me, find someone who
doesn't already know that they've created design disaster. =) Please.)

Thanks!
Liam

Jul 23 '05 #1
8 3035
<ne**@celticbear.com> wrote:
So, is there a way to have two submit buttons that can can be forced to
submit the form to one "action" and the other to another "action"?
No.
At worst what I can do is have one result page that checks to see if
one field is blank and if not, redirect to another page with all the
info in GET, but I really don't like that idea.
Nonetheless, that's the way to do it.
Any suggestions?


See http://www.htmlhelp.com/faq/html/forms.html#two-submit
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Advice is what you ask for when you know the answer but wish you didn't."
Jul 23 '05 #2
ne**@celticbear.com wrote:
I need to have two forms on the page, one for a small search field and
one for a main form submission. Unfortunately any attempt to put one
form tag around the smaller search field throws the whole table
structure out of whak,


Have you tried styling the form?
form {margin: 0;}
might solve your problem but without a URL it's impossible to tell.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 23 '05 #3

Steve Pugh wrote:
ne**@celticbear.com wrote:
I need to have two forms on the page, one for a small search field andone for a main form submission. Unfortunately any attempt to put one
form tag around the smaller search field throws the whole table
structure out of whak,


Have you tried styling the form?
form {margin: 0;}
might solve your problem but without a URL it's impossible to tell.

Good point:
http://gto.ie-studios.net/account.php

You can see the search's text field and button top left.

Styling the form, interesting thought.
Don't think it'll work in this case, because it's not exactly the form
itself that causes the problem.
That field and button top left? It's two different table cells within a
table row that includes a larger cell more to the right. If I try to
turn that row into a separate table so that I can put it into a single
larger cell so I can include FORM tags, that's what messes up the whole
table structure.

(Man I wish I'd known tables were depricated when I started this. Well,
even using tables doing it like I did was a bad idea--I know with
better foreplanning I still could have prevented this from happening.)

Thanks for the feedback!
Liam

Jul 23 '05 #4
ne**@celticbear.com wrote:
Steve Pugh wrote:
ne**@celticbear.com wrote:
>I need to have two forms on the page, one for a small search fieldand >one for a main form submission. Unfortunately any attempt to put one
>form tag around the smaller search field throws the whole table
>structure out of whak,
Have you tried styling the form?
form {margin: 0;}
might solve your problem but without a URL it's impossible to tell.

Good point:
http://gto.ie-studios.net/account.php

You can see the search's text field and button top left.

Styling the form, interesting thought.
Don't think it'll work in this case, because it's not exactly the form
itself that causes the problem.
That field and button top left? It's two different table cells within a
table row that includes a larger cell more to the right. If I try to
turn that row into a separate table so that I can put it into a single
larger cell so I can include FORM tags, that's what messes up the whole
table structure.


I see. You'll need to change some of the background images as well. No
big deal so long as you have the original build files and not just the
cut graphics.

Or you could just split the existing table into two. There's a row
break immediately below the search box that extends right across the
table. Turn it into two tables there.

Preumably this problem is going to appear on other pages as well -
this is a store so there will be lots of forms.

The problem is that your design is very, very inflexible. It's no
wonder that it breaks badly in some browsers already:
http://steve.pugh.net/test/games2order.jpg
(Man I wish I'd known tables were depricated when I started this. Well,
Tables are not deprecated. Tables are perfectly fine when used for
what they were designed for. They were never a good idea for page
layout though.
even using tables doing it like I did was a bad idea--I know with
better foreplanning I still could have prevented this from happening.)


Just scrap it and start again, it will save headaches and likely money
later on to do it properly now. It's not as if the world economy will
collapse if yet another online games store doesn't go live for a few
more weeks.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 23 '05 #5
Steve Pugh wrote:
ne**@celticbear.com wrote:
Steve Pugh wrote:
I see. You'll need to change some of the background images as well. No big deal so long as you have the original build files and not just the cut graphics.
"Need to change them", as in, in order to make the table alterations
work?
Or for some other reason I've yet to discover?
Or you could just split the existing table into two. There's a row
break immediately below the search box that extends right across the
table. Turn it into two tables there.
I'll play around with that. Thanks. =)
Preumably this problem is going to appear on other pages as well -
this is a store so there will be lots of forms.
Very good point. Until I do have a whole new page design, I may just
remove the search field in the order finalization pages. I doubt
there's TOO much of a need to seach for an item while checking out. You
can always "continue shopping" by clicking a link that takes you to
some product pages.
The problem is that your design is very, very inflexible. It's no
wonder that it breaks badly in some browsers already:
http://steve.pugh.net/test/games2order.jpg
What browser/OS is that? It looks fine on IE, and Firefox in Windows,
but breaks up similar yet different than that in Firefox in Linux. I
was hoping it would be only that combination of browser/OS, and I could
work on that later...but it looks like there's another.
Yeah, I don't like the kind of inflexibility that occurred. This
started as using a templatemonster template that I changed in order to
create a mock-up for a look, and adding different elements for the
client took off into using the mock-up design structure and it became
too big to go back and redo in the time I have.
I'm going to need to just get this up and running ASAP, and then go
back and redo the design when I have some breathing room.
(Man I wish I'd known tables were depricated when I started this. Well,
Tables are not deprecated. Tables are perfectly fine when used for
what they were designed for. They were never a good idea for page
layout though.
Really? Before CSS really took off, I can't imagine any other way of
doing layout that allows you to place elements side-by-side or in fixed
places. When I learned HTML circa 1996, tables were the way to go and
CSS hadn't even been thought of yet. <FONT> was still prominent even.
=)
even using tables doing it like I did was a bad idea--I know with
better foreplanning I still could have prevented this from

happening.)
Just scrap it and start again, it will save headaches and likely money later on to do it properly now. It's not as if the world economy will
collapse if yet another online games store doesn't go live for a few
more weeks.

LOL tell that to my client. =)
No, I have to get this up and running ASAP. Getting it "live" is the
most important priority to the client right now, even if it's
unfinished. So once I do that, I can then go back and do some reworking
with some breathing room.

Thanks so much for your time and advice!!
Liam

Jul 23 '05 #6
cjm
"Darin McGrew" <mc****@stanfordalumni.org> wrote in message
news:cv**********@blue.rahul.net...
<ne**@celticbear.com> wrote:
So, is there a way to have two submit buttons that can can be forced to
submit the form to one "action" and the other to another "action"?


No.


Yes, though you need to use Javascript (and that comes with it's own
baggage):

<input type="submit" name="submit1" onclick="formname.action='page1.htm';">
<input type="submit" name="submit2" onclick="formname.action='page2.htm';">

....or something like that...

I actually run a validation script, which then redirects to an appropriate
page, but the effect is the same.

I use this technique on an intranet system, so I can be sure that Javascript
is enabled, but on the WWW you can't be so sure, so beware.
At worst what I can do is have one result page that checks to see if
one field is blank and if not, redirect to another page with all the
info in GET, but I really don't like that idea.


Nonetheless, that's the way to do it.


That's *one* way to do it.

Personally, I agree with Steve - rewrite the page and use two forms...

Just my £0.02

Chris
Jul 23 '05 #7
<ne**@celticbear.com> wrote:
So, is there a way to have two submit buttons that can can be forced to
submit the form to one "action" and the other to another "action"?

cjm <cj*******@removeme.yahoo.co.uk> wrote: Yes, though you need to use Javascript (and that comes with it's own
baggage):
Baggage? Such as the fact that it doesn't work when disabled/unavailable?

Non-JavaScript functionality is a priority 1 checkpoint according to the
W3C's Web Content Accessibility Guidelines:
http://www.w3.org/TR/WAI-WEBCONTENT/

See also http://www.xs4all.nl/~sbpoley/webmatters/whatnojs.html
I use this technique on an intranet system, so I can be sure that Javascript
is enabled, but on the WWW you can't be so sure, so beware.


IME, you can't be sure on an intranet either. I witnessed a couple fiascoes
at my previous job, when critical intranet sites were deployed, but only
worked in certain configurations of certain browsers. Surprise--a lot of
employees had business- and disability-related reasons for using other
browsing environments.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"FAILURE IS NOT AN OPTION. It comes bundled with the software."
Jul 23 '05 #8

Darin McGrew wrote:
<ne**@celticbear.com> wrote:
So, is there a way to have two submit buttons that can can be forced to submit the form to one "action" and the other to another
"action"?

cjm <cj*******@removeme.yahoo.co.uk> wrote:
Yes, though you need to use Javascript (and that comes with it's
own baggage):


Baggage? Such as the fact that it doesn't work when

disabled/unavailable?
Non-JavaScript functionality is a priority 1 checkpoint according to the W3C's Web Content Accessibility Guidelines:
http://www.w3.org/TR/WAI-WEBCONTENT/

See also http://www.xs4all.nl/~sbpoley/webmatters/whatnojs.html
Very interesting!
Something I've feared (since I love what JavaScript allows me to do)
and hoped for (since I despise troubleshooting JavaScript.)

Here's a question: I know .Net (ASP.Net certainly, and I suppose C#.Net
is no different,) allows one to make Web applications that do
JavaScript like things: like altering the page and data in real-time
without having to reload the page.
I'm not positive how .Net does the stuff it does, but can turning
JavaScript support off on the browser affect these things?
If not, I think I may want to start learning .Net....
"FAILURE IS NOT AN OPTION. It comes bundled with the software."


ROTFLMAO!
I need to make that into a sign near my desk. =)

Jul 23 '05 #9

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

Similar topics

2
by: Poko | last post by:
Hi all Was wondering if someone could show me how I can use javascript to submit a form using three separate buttons that would cause the forms action="" to hold different values? Poko
4
by: Jiho Han | last post by:
What is the best way to check whether the page is simply a postback or the form has been submit with the intention of doing something? In the olden days, I used to check for a form field name...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
6
by: RobR | last post by:
We have a customer using our application that has a problem. Within our app, we have a two different forms (one generates an email, the other a fax via a webservice). When they click the submit...
5
by: Advo | last post by:
Basically, im redesigning a form page on our website. Currently the user submits the form, it does a few javascript checks and either submits to the "processstuff.php" page, or gives the user a...
6
by: Bill | last post by:
I'm building a simple file management application using Classic ASP VBScript that has a form to input page content, and file name. After the form is submitted, the application will check to see...
6
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1"...
6
by: 0utlawza | last post by:
Hi Guys It seems i posted this in the incorrect topic, so i am reposting here. Please excuse the Newbie question. I am not really a programmer so excuse me if i dont clarify my point...
13
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the...
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=()=>{
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...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.