Subversion Repositories SmartDukaan

Rev

Rev 10805 | Rev 10946 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10805 Rev 10916
Line 170... Line 170...
170
  if(color != null){
170
  if(color != null){
171
   itemId = (color.options[color.selectedIndex].value); 
171
   itemId = (color.options[color.selectedIndex].value); 
172
  }else{
172
  }else{
173
    itemId = items[0].id;
173
    itemId = items[0].id;
174
  }
174
  }
-
 
175
  var url = document.URL;
-
 
176
  url = url.split('-');
-
 
177
  itemName = url.pop();
175
  if(document.getElementById('email').style.display == 'block'){
178
  if(document.getElementById('email').style.display == 'block'){
176
    var email = document.getElementById('email').value;
179
    var email = document.getElementById('email').value;
177
    email = email.trim();
180
    email = email.trim();
178
      var atpos = email.indexOf("@");
181
      var atpos = email.indexOf("@");
179
      var dotpos = email.lastIndexOf(".");
182
      var dotpos = email.lastIndexOf(".");
Line 195... Line 198...
195
      if(email.indexOf(' ') != -1){  
198
      if(email.indexOf(' ') != -1){  
196
          document.getElementById('error').style.display = "block";
199
          document.getElementById('error').style.display = "block";
197
          document.getElementById('error').innerHTML ='Please remove space from email field!';
200
          document.getElementById('error').innerHTML ='Please remove space from email field!';
198
          window.scrollTo(0,0); return false;
201
          window.scrollTo(0,0); return false;
199
      }
202
      }
200
      var url = base_url+'cart/add/'+itemId+'/'+email;
203
      var url = base_url+'cart/add/'+itemId+'/'+email+'/'+itemName;
201
  }
204
  }
202
  else{
205
  else{
203
    var url = base_url+'cart/add/'+itemId+'/null';
206
    var url = base_url+'cart/add/'+itemId+'/null'+'/'+itemName;
204
  }
207
  }
205
    //window.location.href = url;
208
    //window.location.href = url;
206
    microAjax(url, function(res)
209
    microAjax(url, function(res)
207
      {
210
      {
208
      debugger;
211
      debugger;