473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Jun 27 '08 #1
6 2139
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 STUDIO
http://www.LittleWorksStudio.com
Jun 27 '08 #2
On Jun 25, 12:50*am, "Jonathan N. Little" <lws4...@central.netwrote:
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
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
Jun 27 '08 #3
shapper wrote:
On Jun 25, 12:50 am, "Jonathan N. Little" <lws4...@central.netwrote:
>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>
<snip signature>
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...
>
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
Jun 27 '08 #4
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 STUDIO
http://www.LittleWorksStudio.com
Jun 27 '08 #5
On Jun 25, 3:15*pm, "Jonathan N. Little" <lws4...@central.netwrote:
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
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
Jun 27 '08 #6
Scripsit shapper:
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.
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/

Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Astra | last post by:
Hi everybody Need your help. I have a DB-extracted list of say 5 items per page, which have links on each one that takes you to more detailed info on the 'clicked' particular item. When you...
6
by: Daniele Baroncelli | last post by:
Hi guys, I would like to change the text in an anchor. es. from <a id="idanchor">oldtext</a> to
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
4
by: CJ Taylor | last post by:
Hey, how do I use the anchor property? I have it set to Top, Left, but when I expand the form, it doesn't grow with it... What am I missing? Thanks, CJ
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
10
by: elibol | last post by:
Hi, Is there an event that fires when the back or forward button on a browser is pressed? I need an event to fire when someone clicks the back or forward button after an anchor has been set. ...
5
by: Randy Webb | last post by:
The list below has the current section number, proposed anchor name, and then the current title of that section. Some make sense, some don't. There are a few that don't have proposed anchor names...
3
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.