I have the following input
:
<input type="radio" id="isgift0" name="isgift" value="0" class="arredondado" <?php if(Mage::getSingleton('core/session')->getInputMensagem() == 1){echo "checked='checked'"} ?> />
Trying to check it via php
is not working because it is not being checked. By doing this via jQuery
, it is checked correctly, however it takes a lot of time to execute this and it affects the functionality of the page.
Check via jQuery
:
$j(document).ready(function () {
<?php
if(Mage::getSingleton('core/session')->getInputMensagem() == 1) {
?>
$j('#isgift0').prop('checked','checked');
$j('#isgift0').click();
<?php
}
?>
});
I wanted to know if there would be any way to do this same check, but in a faster way.