1

enter image description hereHTML code: .....

<input onclick="removeAttr(i)" name="autoselected[]" value="i" class="radio" checked="checked" type="radio">

....

function removeAttr(i) {

preSelected = $$('[input[type=radio][name=autoselected[]][value=' + i + ']');

 preSelected.each(function (item) {
        // De-Select a selected option in Prototype. 
 });

}

any idea how to achieve this?

1 Answer 1

0

First of all, this is not magento question. You should only ask magento related question here.

However, I will try to give you heads on.

Try this code:

//$ = jQuery;
$(':radio').mousedown(function(e){
  var $self = $(this);
  if( $self.is(':checked') ){
    var uncheck = function(){
      setTimeout(function(){$self.removeAttr('checked');},0);
    };
    var unbind = function(){
      $self.unbind('mouseup',up);
    };
    var up = function(){
      uncheck();
      unbind();
    };
    $self.bind('mouseup',up);
    $self.one('mouseout', unbind);
  }
});

Ref

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.