Welcome Guest, Not a member yet? Register   Sign In
Javascript validation doesn't work
#4

[eluser]akho[/eluser]
and here is my javascript

Code:
function jsUpdateCart(){
  var parameter_string = '';
  allNodes = document.getElementsByClassName("process");
  for(i = 0; i < allNodes.length; i++) {
      var tempid = allNodes[i].id;
    var temp = new Array;
    temp = tempid.split("_");
     var real_id = temp[2];
     var real_value = allNodes[i].value;
    parameter_string += real_id +':'+real_value+',';
  }

  var params = 'ids='+parameter_string;
  var ajax = new Ajax.Updater(
    'ajax_msg','/shop/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
    );

}

function showMessage(req){
  $('ajax_msg')[removed] = req.responseText;
  location.reload(true);
}

function jsRemoveProduct(id){
    var params = 'id='+id;
    var ajax = new Ajax.Updater(
        'ajax_msg','/welcome/ajax_cart_remove', {method:'post',parameters:params,onComplete:showMessage}
    );
}

When i press update or delete it doesn’t work. Could someone please tell me what’s wrong with my code? I'm already call this javascript in my template with this code
Code:
&lt; script type="text/javascript" src="&lt;?php echo base_url();?&gt;js/customtools.js"&gt; < /script >


Messages In This Thread
Javascript validation doesn't work - by El Forum - 04-12-2011, 04:28 AM
Javascript validation doesn't work - by El Forum - 04-12-2011, 04:29 AM
Javascript validation doesn't work - by El Forum - 04-12-2011, 04:30 AM
Javascript validation doesn't work - by El Forum - 04-12-2011, 04:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB