Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Cancel button

Quote Reply
Cancel button
Like most others, I have Add and Modify forms with Submit buttons on the bottom. I would like the user to be able to abandon any changes and return to the page that called the form, or barring that, to return to a page of my choice. The most important aspect is to cancel the changes, but not affect the data that existed before the form was started.

Realizing "reset" clears the fields, I need to take this one step further and leave the form without changing the data. Can someone help me with what I think it probably some simple HTML that my feeble mind is forgetting?

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Cancel button In reply to
Call me stupid. It never occurred to me that I could associate a Cancel button with a designated web page... it's just another way of leaving the page without processing the data.

Sorry to have wasted anyone's time!

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Cancel button In reply to
So now I'm feeling really stupid, but I can't seem to get a Cancel button to work. Every time I click it, instead of taking me to the desired page, it finishes processing the page as if I clicked the submit button.

Here's a relevant snippet of code so someone can show me my idiotic ways (this is in the modify.html template):

Code:
<tr><td></td><td><%body_font%>
<input type="SUBMIT" name="modify_submit" value="Modify Listing"></td>
<td><form method="LINK" action="(address being linked to)"><input type="SUBMIT" value="Cancel"></form>
</font></td></tr>

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Cancel button In reply to
Are u trying to have your <form ..></form> within a already existing <form..></form> block. If yes it will not work.

Crude but easy soln : Next to your Submit Button include this:

&nbsp;&nbsp;<input type="button" value="Cancel"
onclick="parent.location='http://www.gossamer-threads.com'" />

replace gossamer-threads.com with your url

BTW, if you use Reset button
&nbsp;&nbsp;<input type="reset" value="Reset" name="reset" class="submit" />

Say on modify.htm it wouldn't clear the contents. It would just clear any thing that you typed extra. But it will not work on any WYSIWYG editor being used in textareas i suppose.

Give it a try

Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================

Last edited by:

HyperTherm: May 26, 2005, 11:46 PM
Quote Reply
Re: [HyperTherm] Cancel button In reply to
Hi,

Mmm.. wouldn't this work?

&nbsp;&nbsp;<input type="button" value="Cancel"
onclick="history.back()" />

?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Cancel button In reply to
He wanted Cancel to take him to his "Other Page" :=)

>>
I would like the user to be able to abandon any changes and return to the page that called the form, or barring that, to return to a page of my choice. The most important aspect is to cancel the changes, but not affect the data that existed before the form was started.




Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================

Last edited by:

HyperTherm: May 27, 2005, 8:16 PM
Quote Reply
Re: [HyperTherm] Cancel button In reply to
In Reply To:
Are u trying to have your <form ..></form> within a already existing <form..></form> block. If yes it will not work.

Crude but easy soln : Next to your Submit Button include this:

&nbsp;&nbsp;<input type="button" value="Cancel"
onclick="parent.location='http://www.gossamer-threads.com'" />

replace gossamer-threads.com with your url

BTW, if you use Reset button
&nbsp;&nbsp;<input type="reset" value="Reset" name="reset" class="submit" />

Say on modify.htm it wouldn't clear the contents. It would just clear any thing that you typed extra. But it will not work on any WYSIWYG editor being used in textareas i suppose.

Give it a try
Yes, I was trying to nest the form within a form... not supported, I guess.

I was unsure of the use of JavaScript (onclick)... I've been wondering if many people are in the habit of turning it off like they often do cookies.

I wasn't sure how Reset would look... and didn't want to scare anyone who clicked it, but I really want them to be able to have a bail-out option (one staffer has been begging me to allow a person to log off from that page, but I'd rather not dig into that hornet's nest).

I'll try your onclick idea. Thanks.

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com