Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. $('#soff_gar').select2({placeholder: "Scegli", initSelection: true }).select2("val","<?php echo $garante; ?>");
  2.  
  3. $('#soff_gar').select2({placeholder: "Scegli", initSelection: true }).val("<?php echo $garante; ?>");
  4.  
  5. $('#soff_gar').select2({placeholder: "Scegli"}).val("<?php echo $garante; ?>");
  6.  
  7. <select id="mySelect">
  8. <option value="volvo">Volvo</option>
  9. <option value="saab">Saab</option>
  10. <option value="mercedes">Mercedes</option>
  11. <option value="audi">Audi</option>
  12. </select>
  13.  
  14. $("#mySelect").select2();
  15. $("#mySelect").val("audi").trigger("change");
  16.  
  17. $('#soff_gar').select2({
  18. placeholder: "Scegli",
  19. initSelection: true
  20. });
  21. $('#soff_gar').val(<?php echo $garante; ?>).trigger("change");
  22.  
  23. <option value="audi" selected>Audi</option>
  24.  
  25. var regex = /([^=&?]+)=([^&#]*)/g, params = {}, parts, key, value;
  26.  
  27. while((parts = regex.exec(url)) != null) {
  28. key = parts[1], value = parts[2];
  29. var isArray = /[]$/.test(key);
  30.  
  31. if(isArray) {
  32. params[key] = params[key] || [];
  33. params[key].push(value);
  34. }
  35. else {
  36. params[key] = value;
  37. }
  38. }
  39.  
  40. return params; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement