473,241 Members | 1,617 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,241 software developers and data experts.

One form two destinations without JavaScript?

M2
Hi,
a have a single form whose elements reside in a table. I want to present a
"Submit" and "Cancel" button at the bottom each of which have a different
destination. This is of course easy to do if you either a) use javascript on
a button or b) go to the dark side and put a form within a table. I would
like to avoid these two techniques if possible. Any ideas?

Matt.
Jul 20 '05 #1
3 4010
"M2" <m2@nowhere.com> wrote:
a have a single form whose elements reside in a table.
Is it relevant? Why? Why don't you post a URL?
I want to
present a "Submit" and "Cancel" button
Virtually all "Cancel" buttons are worse than useless. They hardly help
the user, but often cause serious damage.
at the bottom each of which
have a different destination.
I think we now all guess the context and "purpose" of those buttons.
This is of course easy to do if you
either a) use javascript on a button or b) go to the dark side and
put a form within a table.
What's dark about b)? All the rest is dark, though.
I would like to avoid these two
techniques if possible. Any ideas?


If you have something that actually submits some data to some
processing, redesign the form. If not, remove the form. If problems
remain, post the URL or, if you want quick help, check the FAQ.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2


M2 wrote:
Hi,
a have a single form whose elements reside in a table. I want to present a
"Submit" and "Cancel" button at the bottom each of which have a different
destination. This is of course easy to do if you either a) use javascript on
a button or b) go to the dark side and put a form within a table. I would
like to avoid these two techniques if possible. Any ideas?


Here's a possible solution:
have two different "submit" buttons, with different names. On the CGI
side, check for the existence of the variable <name> (you do this
differently if you use GET or POST). Here's an example using PHP:

<form name="myform" method="POST" action"http://url/post.php">
<input type="text" name="information">
<input type="submit" name="submit_ok" value="Submit">
<input type="submit" name="submit_cancel" value="Cancel">
</form>

And here is post.php:

<?

if (isset($_POST["submit_ok"]))
{
// process SUBMIT
}
else if (isset($_POST["submit_cancel"]))
{
// process cancel
}

?>

I haven't tested this though but it should work.

--
luc wastiaux - email: du*******@airpost.net
Jul 20 '05 #3
M2
> Here's a possible solution:
have two different "submit" buttons, with different names. On the CGI
side, check for the existence of the variable <name> (you do this
differently if you use GET or POST). Here's an example using PHP:


Thanks I hadn't thought of that, makes sense though.

Matt.
Jul 20 '05 #4

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

Similar topics

8
by: Daniel | last post by:
Ah, new question =) (Well, half-new, I asked something similar a while ago, but disregarded the question myself) Is there any way to post data to Javascript in a new page without using a form...
3
by: Christian | last post by:
Hello, I was wondering if it is possible to create in one form 2 destination for example <form method="post" action="test.html"> <textarea name="content"> Test </textarea> <inbut...
2
by: David Pautler | last post by:
I'm creating a web-based authoring tool where one form encompasses several sections for editing. I'd like each section to have its own reset button, so that use of that button affects only that...
2
by: webbedfeet | last post by:
Hi I hope someone can help me. I have a client side form validation script which works perfectly in IE but clicking "Submit" in Mozilla does nothing - the form won't submit. Is there something I...
5
by: W.Sh | last post by:
Hello Dear Javascript Experts! I really suck at Javascript at the moment, and I could really use some assistance... I have an HTML form, and I'm using javascript to validate the various...
2
by: thilandeneth | last post by:
i need to do telnet via a web server please give me a idia to initiate the project following requirements are needed 1 Create web based custom telnet client to communicate with remote...
1
by: Yinna | last post by:
Hi, I'm not a programmer, so please pardon my question if it seems basic. I'm setting up a tour web site, where site visitors can click on a link in destinations page to make bookings (web...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
6
by: c h e r r y | last post by:
Hi! I have this code that only submit to checklogin.php I've tried interchanging the destinations for the submit and i always end up having the data only at the last argument. Please help me. ...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
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
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...

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.