Jump to content

Archived

This topic is now archived and is closed to further replies.

xyn

Buttons as Text

Recommended Posts

Hey,
How could i change my buttons into TEXT?

Share this post


Link to post
Share on other sites
Is this what you mean:
[code]<style type='text/css'>
body, button.link_style, input.link_style {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}

button.link_style, input.link_style {
border: 0px;
padding: 0px;
cursor: pointer;
background-color: white;
color: blue;
text-decoration: underline;
}
</style>

Click <button type='submit' class='link_style'>here</button> to submit the form[/code]

Share this post


Link to post
Share on other sites
i guess my question is: [b]why?[/b]

i'm sure there are ways to style it as you want, like Daniel0 suggested, but there may be better approaches to get your desired result. could you explain what your goal is, and maybe we can help you refine your method a tad.

Share this post


Link to post
Share on other sites
Plus, you should really use input type=button, since BUTTON can break some browsers.

Share this post


Link to post
Share on other sites
[quote author=obsidian link=topic=112103.msg454916#msg454916 date=1161349064]
i guess my question is: [b]why?[/b]

i'm sure there are ways to style it as you want, like Daniel0 suggested, but there may be better approaches to get your desired result. could you explain what your goal is, and maybe we can help you refine your method a tad.
[/quote]

Basically, I wanted a Text Hyperlink instead of a button, but to do the same things as a button; Ie I have a link called Submit, and it submits a form.

Share this post


Link to post
Share on other sites
If you want to use text to submit the form then do somthing like this:
[code]<a href="#" onclick="document.formNameHere.submit">Submit form[/code]

Make sure you give your form an name and change formNameHere to what you named your form as. Or if you only have 1 form on the page use form[0] instead

Share this post


Link to post
Share on other sites
[quote author=wildteen88 link=topic=112103.msg455510#msg455510 date=1161455555]
If you want to use text to submit the form then do somthing like this:
[code]<a href="#" onclick="document.formNameHere.submit">Submit form[/code]

Make sure you give your form an name and change formNameHere to what you named your form as. Or if you only have 1 form on the page use form[0] instead
[/quote]

exactly. this way, you can style your link as text instead of having to use negative CSS to remove all the defaults of the button

Share this post


Link to post
Share on other sites
[quote author=wildteen88 link=topic=112103.msg455510#msg455510 date=1161455555]
If you want to use text to submit the form then do somthing like this:
[code]<a href="#" onclick="document.formNameHere.submit">Submit form[/code]

Make sure you give your form an name and change formNameHere to what you named your form as. Or if you only have 1 form on the page use form[0] instead
[/quote]

that didnt work for me :l
I made my form name "loginForm" and used your method it just goes to top of the page.

Share this post


Link to post
Share on other sites
Should be document.loginForm.submit() -- note the function call.  And strictly speaking, you should have a return false if you don't want the href to be followed, every though submitting the form will make this unnecessary.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.