Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   cancel button in html form (http://www.go4expert.com/forums/cancel-button-html-form-t15788/)

souri_sen 10Jan2009 22:20

cancel button in html form
 
Hello all, I have a problem to create a form's cancel button. It will be appreciable if anybody help me.

The code is about the cancel button, im actully making a form which has a cancel button. If the button is pressed it will redirect in another page.

shabbir 11Jan2009 11:01

Re: cancel button in html form
 
Write the code in the OnClick Event to redirect the page to other url. Something similar to the Go Advanced button in the quick reply

skp819 3Feb2009 11:16

Re: cancel button in html form
 
Hope that links will help you............

http://www.useit.com/alertbox/20000416.html

http://devedge-temp.mozilla.org/libr...de/tags10.html

vks21 25Feb2009 12:05

Re: cancel button in html form
 
I am not sure about this But you should try it yourself..perhaps it works correctly..Good luck.
Code:


object.Cancel


akshits 11May2009 10:58

Re: cancel button in html form
 
Below is a code help for you:-

Code:


<script>
function $(id) { return document.getElementById(id); }
</script>

<form action="...php" id="frm">

[CODE here]

<input type="submit" value="Submit form">
<button onclick="$('frm').action='otherPage.php';$('frm').submit();">Cancel</button>

[CODE here]

</form>

Regards,
Akshit Soota

akras14 5Aug2009 03:09

Re: cancel button in html form
 
<input type="button" name="Cancel" value="Cancel" onclick="window.location = 'yourpage.html' " />

GreatGizzards 24Nov2010 13:02

Re: cancel button in html form
 
<a href="url.html"><input type="button" name="cancel" value="Cancel" /></a>

This ones particularly nice because it only depends on html

a-nerd-in-time 19Dec2012 22:56

Re: cancel button in html form
 
GreatGizzards, thank you!
works perfectly and I also wanted to mention that I needed to re-direct to a php file to instead of url.html, I entered home.php and bingo, it worked.


All times are GMT +5.5. The time now is 02:31.