Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form button styled as hyperlink #3724

Closed
dyve opened this issue Jun 5, 2012 · 11 comments
Closed

Form button styled as hyperlink #3724

dyve opened this issue Jun 5, 2012 · 11 comments

Comments

@dyve
Copy link

dyve commented Jun 5, 2012

I'd like a btn-hyperlink class that can be used like all btn* classes but styles the button like a hyperlink. Great for small inline forms etc. where a normal buttons takes up too much space.

@mastermunj
Copy link

Wouldn't button mini "btn-mini" suffice? It takes much less space. Or do you want plain link?

@dyve
Copy link
Author

dyve commented Jun 5, 2012

.btn-mini is great, but it is slightly higher than text
A plain link would be ideal for integration in simple forms, tables, etc

@joshdover
Copy link

Why wouldn't you just us a regular tag?

@joshdover
Copy link

A regular 'a' tag that is

@j-hernandez
Copy link

Assuming jQuery

$(document).ready(function(){
  $("a.submit").click(function(){
     $("#form").submit();
  });
});

Then just <a class='submit'>Submit</a> after your form or inline or w/e. No use styling buttons like links when links will do?

@dyve
Copy link
Author

dyve commented Jun 6, 2012

I'd use a jQuery selector that gets the first enclosing form based on the a tag. But just styling the button would be much better, there shouldn't be any need for JavaScript for something as simple as this.

@j-hernandez
Copy link

It just seems like a step backward to me is all, although I guess there is stuff there to turn <a> tags into buttons so fair enough!

@giuseppeg
Copy link

@j-hernandez every time you use a link to submit a form God kills a cat. avoid that.

@dyve .btn-mini is a presentational name, so it is bad for you, but nobody who is using bootstrap cares about semantic names I guess.

Anyway you can implement it in seconds: http://jsfiddle.net/eW2gd/

@dyve
Copy link
Author

dyve commented Jun 20, 2012

@giuseppeg I don't have a problem with the name .btn-mini, there must be some misunderstanding there. Thanks for the example code, there were a few details I missed in my solution.

@mdo
Copy link
Member

mdo commented Jun 21, 2012

For now we'll avoid adding this since we advocate folks using buttons only for actions rather than hyperlinks. Links should point to destinations and buttons should handle actions.

@mdo mdo closed this as completed Jun 21, 2012
@TedBritt
Copy link

TedBritt commented May 9, 2016

Thanks for the clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants