Connecting Tech Pros Worldwide Help | Site Map

Restyle Anchor

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 27th, 2008, 07:20 PM
shapper
Guest
 
Posts: n/a
Default Restyle Anchor

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.

However, I am having a problem in styling the anchor to make it look
the same as the Submit input.

Could someone tell me how to style the anchor and if using an anchor
is better then using the button?

My code:
http://www.27lamps.com/Labs/Buttons/Buttons.html

Thanks,
Miguel

  #2  
Old June 27th, 2008, 07:20 PM
Jonathan N. Little
Guest
 
Posts: n/a
Default Re: Restyle Anchor

shapper wrote:
Quote:
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 STUDIO
http://www.LittleWorksStudio.com
  #3  
Old June 27th, 2008, 07:20 PM
shapper
Guest
 
Posts: n/a
Default Re: Restyle Anchor

On Jun 25, 12:50*am, "Jonathan N. Little" <lws4...@central.netwrote:
Quote:
shapper wrote:
Quote:
Hello,
>
Quote:
On a bottom of a form I have 2 buttons: Submit and Cancel.
>
Quote:
* Submit is an input and submits the form.
* Cancel should just redirect the user to a new page without
submitting the form.
>
Quote:
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
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? What
do you think?

Thanks,
Miguel
  #4  
Old June 27th, 2008, 07:20 PM
Jonathan N. Little
Guest
 
Posts: n/a
Default Re: Restyle Anchor

shapper wrote:
Quote:
On Jun 25, 12:50 am, "Jonathan N. Little" <lws4...@central.netwrote:
Quote:
>shapper wrote:
Quote:
>>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>
<snip signature>
Quote:
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.
Sure you can, careful markup style as you need to...
Quote:
>
Finally, could I place a input of type button inside an anchor?
What good would that do?



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  #5  
Old June 27th, 2008, 07:20 PM
Jonathan N. Little
Guest
 
Posts: n/a
Default Re: Restyle Anchor

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
Quote:
<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 STUDIO
http://www.LittleWorksStudio.com
  #6  
Old June 27th, 2008, 07:20 PM
shapper
Guest
 
Posts: n/a
Default Re: Restyle Anchor

On Jun 25, 3:15*pm, "Jonathan N. Little" <lws4...@central.netwrote:
Quote:
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
>
Quote:
*<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
Hmmm, thank you for the help, but it does not work.
I need the two buttons to be side by side ... even if I set a right
margin to cancel button they will overlap on text resizing.

I will keep trying ...

Thanks,
Miguel
  #7  
Old June 27th, 2008, 07:20 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Restyle Anchor

Scripsit shapper:
Quote:
On a bottom of a form I have 2 buttons: Submit and Cancel.
Wrong design. The "Cancel" button is really a "destroy whatever the user
has done" button.
Quote:
Submit is an input and submits the form.
Cancel should just redirect the user to a new page without
submitting the form.
Pointless. No need to style it. Redesign it.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.