![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, On a bottom of a form I have 2 buttons: Submit and Cancel. Submit is an input and submits the form. Cancel should just redirect the user to a new page without submitting the form. I need the Cancel button to look the same as the Submit button. If I use an input of type button as Cancel button I am able to do that but then I need to rely on "onclick" to redirect the user ... I think would be better to use an anchor. |
#3
| |||
| |||
|
|
shapper wrote: Hello, On a bottom of a form I have 2 buttons: Submit and Cancel. * Submit is an input and submits the form. * Cancel should just redirect the user to a new page without submitting the form. I need the Cancel button to look the same as the Submit button. If I use an input of type button as Cancel button I am able to do that but then I need to rely on "onclick" to redirect the user ... I think would be better to use an anchor. Or you can have the *"cancel" button in another form that submits "nothing" to that other page form action="scriptThatDoesDomething.php" ... input type="submit" value="Submit Form" /form form action="theOtherPage.php" input type="submit" value="Cancel" /form -- Take care, Jonathan ------------------- LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com |
#4
| |||
| |||
|
|
On Jun 25, 12:50 am, "Jonathan N. Little" <lws4... (AT) central (DOT) net> wrote: shapper wrote: Hello, On a bottom of a form I have 2 buttons: Submit and Cancel. Submit is an input and submits the form. Cancel should just redirect the user to a new page without submitting the form. I need the Cancel button to look the same as the Submit button. If I use an input of type button as Cancel button I am able to do that but then I need to rely on "onclick" to redirect the user ... I think would be better to use an anchor. Or you can have the "cancel" button in another form that submits "nothing" to that other page form action="scriptThatDoesDomething.php" ... input type="submit" value="Submit Form" /form form action="theOtherPage.php" input type="submit" value="Cancel" /form |
|
Is this usually done? Having a form just redirecting to a page? However, I have a problem: I need to place both buttons side by side and in that case I think it will not be possible. |
|
Finally, could I place a input of type button inside an anchor? |
#5
| |||
| |||
|
|
style type="text/css" div.wrapper { position: relative; min-width: 15em; } div.wrapper form.nogo { position: absolute; right: 0; bottom: 0;} |
#6
| |||
| |||
|
|
Jonathan N. Little wrote: * Oops, always double check in IE! IE has a default bottom margin on forms, so add a third rule to line up buttons *<style type="text/css" *div.wrapper { position: relative; min-width: 15em; } *div.wrapper form.nogo { position: absolute; right: 0; bottom: 0;} div.wrapper form { margin: 0; } -- Take care, Jonathan ------------------- LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com |
#7
| |||
| |||
|
|
On a bottom of a form I have 2 buttons: Submit and Cancel. |
|
Submit is an input and submits the form. Cancel should just redirect the user to a new page without submitting the form. |
![]() |
| Thread Tools | |
| Display Modes | |
| |