hi, i’m in a restful mode and i’ve a delete link. In this case i want to
use a link, because i like it more than a button, but to do a delete
method the user should have javascript actived…otherwise it won’t
work… so, how can i show the link when javascript is actived and a
button in the other case? or there is another method to do it simple and
always with a link?
thanks
john wrote:
hi, i’m in a restful mode and i’ve a delete link. In this case i want to
use a link, because i like it more than a button, but to do a delete
method the user should have javascript actived…otherwise it won’t
work… so, how can i show the link when javascript is actived and a
button in the other case? or there is another method to do it simple and
always with a link?
thanks
anyone?
I’ve never tried this, but how about:
function setButtonToLink()
{
$(‘yourButtonId’).replace(’ path/you/want/to/link/to your link ');
}
function onLoad()
{
setButtonToLink();
}
If js is not enabled, the button would be a button. If js is enabled, it
would be replaced with your link.
Right?
David S.-2 wrote:
–
Posted via http://www.ruby-forum.com/.
–
View this message in context:
http://www.nabble.com/%3Adelete-%3D>-Button%2C-link-and-javascript...how-can-i-do-this--tf3575862.html#a10007306
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
Steve R. wrote:
I’ve never tried this, but how about:
function setButtonToLink()
{
$(‘yourButtonId’).replace(’ path/you/want/to/link/to your link ');
}function onLoad()
{
setButtonToLink();
}If js is not enabled, the button would be a button. If js is enabled, it
would be replaced with your link.Right?
thanks, i’ll try