473,769 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3071
<ne**@celticbea r.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****@stanford alumni.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****@stanfor dalumni.org> wrote in message
news:cv******** **@blue.rahul.n et...
<ne**@celticbea r.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="formna me.action='page 1.htm';">
<input type="submit" name="submit2" onclick="formna me.action='page 2.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**@celticbea r.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*******@remo veme.yahoo.co.u k> 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****@stanford alumni.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**@celticbea r.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*******@remo veme.yahoo.co.u k> 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
1609
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
4273
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 used for the submit button: <input type="submit" name="saverecord" value="push me to save"> Then I'd retrieve it using something like:
7
17334
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 to get it to work in Visual Basic. I tried coding it once myself from scratch and then modified a class that I found on a newsgroup (referenced below). Both seem to be doing the same thing and neither works (or rather, they seem to work but the...
6
3522
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 button, IE6 is generating the event 6 times!!! So they end up sending 6 faxes or 6 emails. We simply cannot reproduce this. We can't find anything wrong in our code that might cause this, I can't find anything in MS Technet about IE bugs that...
5
1940
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 JS error message.. where they have to go back and fill the details in. Im trying to optimise and make this form/page as best as it can be. Do you think it would be a better idea to continue using JS or use JS then submit to the php page(where...
6
1757
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 if a page with that file name already exists - if the file name already exists the user is quickly notified and asked to provide a different file name for that page. What I would like to do is, when the user submits the form, if the file name...
6
5092
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" onchange="alert(this.name + '=' + this.value);"></label></div> <label>Field 2: <input type="text" name="field2" onchange="alert(this.name + '=' + this.value);"></label></div> </form>
6
1990
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 correctly. I am trying to debug an ex-employee's web code and seem to sinking here. Let me try to explain. We are receiving few blank submit forms via a handful of clients websites. Ordinarily i would not stress too much as it is less that 5% of the form...
13
10569
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 user clicks "yes" or "no". This Object is attached to various HTML elements on the page (buttons, selects etc) and traps any events that they raise that cause the page to submit. If the user has not responded, the Object should cancel the page...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.