473,405 Members | 2,445 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,405 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 4016
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.