In my grails
application there is a view
with a a g:link
tag - it works fine, but the visuals are kind of awkward. Therefore, I want to disguise that g:link
with an ordinary button.
I've tried a span class
and input type="button"
but this did not do the trick.
Side note: I don't want a g:form
with an submit
action.
Any help is really appreciated!
g:link tag does nothing but at the end creates the anchor tag. So anything that you can put inside anchor tag, so with g:link.
You can simply write. <g:link class="create" action="create"><input type="button" /></g:link>
It appears to be a button to user but does the job of g:link tag.
Amit Jain's answer worked but had some problems in ie 8 & 7 (looked like some kind of style overlapping error). This solution worked in all browsers I tested
<button class="class" onClick="window.location = 'www.location.com' ">
<g:message code="share.learnmore"></g:message>
</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With