Skip to main content
added 17 characters in body
Source Link
Paras Sood
  • 2.6k
  • 1
  • 15
  • 23

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attrsetAttribute('is_itchecked', checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy''checkboxMy').attrreadAttribute('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attr('is_itchecked',checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy').attr('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).setAttribute('is_itchecked', checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('checkboxMy').readAttribute('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

deleted 7 characters in body
Source Link
Paras Sood
  • 2.6k
  • 1
  • 15
  • 23

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked folder as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attr('is_itchecked',checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy').attr('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked folder as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attr('is_itchecked',checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy').attr('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attr('is_itchecked',checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy').attr('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

added 913 characters in body
Source Link
Paras Sood
  • 2.6k
  • 1
  • 15
  • 23

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked folder as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attr('is_itchecked',checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy').attr('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

Use this to determine if the checkbox is checked and store it in a variable as a bool value.

After that for postBody you could use:

"mypostdata="+$('my_value').value +"&isChecked="+isChecked;

Where isChecked is the js variable you stored the bool value in and it will be passed to the post param: isChecked

After Edit:

The checked variable in observer function should be a global variable. The var checked folder as it stands is local to the observer function.

you could do something like:

$('checkbox_id').observe('click', function(e) {
            var checked = this.checked;
            $(this).attr('is_itchecked',checked);
        });

Then your Ajax code should become:

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value + "&isChecked=" $('#checkboxMy').attr('is_itchecked'),
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

Here checkboxMy should be the id of the checkbox you are trying to check the status of.

Source Link
Paras Sood
  • 2.6k
  • 1
  • 15
  • 23
Loading