Making the 'Back' link look the same as form.submit "Save"

Does anybody know how Rails paints that cool blue box around the <%=
form.submit “Save” %>
In most of my forms I’ve got a “Back” link ( ex: <%= link_to ‘Back’,
return_path %>.

I’d like this link to share the same ‘look and feel’.

When I look at the browser source the code that rails generates it
shows this;

Has anybody built .css around any of these properties to make this
link look like the same graphic button created by <%= form.submit
“Save” %>?

David

What “cool blue box?” My submit buttons just look like buttons, so you
probably already have some CSS that you could copy.

On Mar 10, 1:31 pm, InventoryTrackers [email protected]

InventoryTrackers wrote:

Has anybody built .css around any of these properties to make this
link look like the same graphic button created by <%= form.submit
“Save” %>?

That button doesn’t even look the same between different browsers. Your
only hope is to use a button to go back instead of a link. CSS isn’t
going to cut it. You can use a button with JavaScript to make it act
like a link to back.

Well actually, I can think of another way, but it’s just the opposite.
You could use a link with JavaScript to replace your submit button,
where the JavaScript submits the form. Then you can create CSS to make
the two links look like buttons.

InventoryTrackers wrote:

Does anybody know how Rails paints that cool blue box around the <%=
form.submit “Save” %>
In most of my forms I’ve got a “Back” link ( ex: <%= link_to ‘Back’,
return_path %>.

try to use Safari browser :slight_smile: Safari - Apple

.snap

tom

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz

I have found that the best solution to this problem is to use an image
button for the submit button, and then use css to apply the same image
to the back link. It’s accessible and requires no javascript.

Tom Z Meinlschmidt wrote:

InventoryTrackers wrote:

Does anybody know how Rails paints that cool blue box around the <%=
form.submit “Save” %>
In most of my forms I’ve got a “Back” link ( ex: <%= link_to ‘Back’,
return_path %>.

try to use Safari browser :slight_smile: Safari - Apple

Yes, If the OP is talking about the Mac OS X “focus ring” (light blue
border surrounding the first responder) then yes, that’s completely
implemented by Safari and has nothing to do with Rails, HTML or CSS.

Brian H. wrote:

I have found that the best solution to this problem is to use an image
button for the submit button, and then use css to apply the same image
to the back link. It’s accessible and requires no javascript.

That’s not a bad approach. It would be one way to get a consistent look,
although not a platform specific look. However, recently I’ve taken the
up the practice that I see a lot of Rails developers using: I just
accept the web by using a standard submit button, and standard
hyperlink. Then I try to design my pages around that concept.

There already exists a “mental model” around form buttons and
hyperlinks. Trying to hide the differences between them behind a visual
facade can actually work against the existing “mental model.” Making a
link look like a button might actually be more confusing. For example
when I see a link I know right away that clicking it will simply take me
to another page. It won’t submit any information related to the form. At
least that’s the expected behavior.

The “mental model,” however, can be broken in a number of different
ways. For example, it is possible to attach a script to a link that does
actually submit information from the form, or change some state on the
server.

@Robert:

I totally agree with your approach. I was merely stating how the
requested goal could be achieved. As web experts, you and I understand
how the web works and how users perceive things, but our clients often
demand that we do things in different ways.

On Fri, Mar 13, 2009 at 9:25 AM, Robert W.

Brian H. wrote:

@Robert:

I totally agree with your approach. I was merely stating how the
requested goal could be achieved. As web experts, you and I understand
how the web works and how users perceive things, but our clients often
demand that we do things in different ways.

@Brian. Yes, thanks for pointing that out. As developers we often do
things we don’t completely agree with in order to satisfy the needs and
wants of our clients.

I DO NOT MARSHALL

  1. [?][?]

On Fri, Mar 13, 2009 at 5:04 PM, Robert W. <