cancel button in html form

Newbie Member
10Jan2009,22:20   #1
souri_sen's Avatar
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.
Go4Expert Founder
11Jan2009,11:01   #2
shabbir's Avatar
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
Contributor
3Feb2009,11:16   #3
skp819's Avatar
Hope that links will help you............

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

http://devedge-temp.mozilla.org/libr...de/tags10.html
Light Poster
25Feb2009,12:05   #4
vks21's Avatar
I am not sure about this But you should try it yourself..perhaps it works correctly..Good luck.
Code:

object.Cancel
Go4Expert Member
11May2009,10:58   #5
akshits's Avatar
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
Newbie Member
5Aug2009,03:09   #6
akras14's Avatar
<input type="button" name="Cancel" value="Cancel" onclick="window.location = 'yourpage.html' " />
Newbie Member
24Nov2010,13:02   #7
GreatGizzards's Avatar
<a href="url.html"><input type="button" name="cancel" value="Cancel" /></a>

This ones particularly nice because it only depends on html
Newbie Member
19Dec2012,22:56   #8
a-nerd-in-time's Avatar
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.