xyn Posted October 20, 2006 Share Posted October 20, 2006 Hey,How could i change my buttons into TEXT? Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/ Share on other sites More sharing options...
Daniel0 Posted October 20, 2006 Share Posted October 20, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-111754 Share on other sites More sharing options...
obsidian Posted October 20, 2006 Share Posted October 20, 2006 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 Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-111805 Share on other sites More sharing options...
fenway Posted October 20, 2006 Share Posted October 20, 2006 Plus, you should really use input type=button, since BUTTON can break some browsers. Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-111917 Share on other sites More sharing options...
xyn Posted October 21, 2006 Author Share Posted October 21, 2006 [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. Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-112360 Share on other sites More sharing options...
wildteen88 Posted October 21, 2006 Share Posted October 21, 2006 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 Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-112385 Share on other sites More sharing options...
obsidian Posted October 21, 2006 Share Posted October 21, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-112440 Share on other sites More sharing options...
xyn Posted October 23, 2006 Author Share Posted October 23, 2006 [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 :lI made my form name "loginForm" and used your method it just goes to top of the page. Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-113328 Share on other sites More sharing options...
fenway Posted October 24, 2006 Share Posted October 24, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/24527-buttons-as-text/#findComment-113472 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.