Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $("#gift_options").hide();
  4. $("#Email").hide();
  5.  
  6.  
  7. $(function () {
  8. $("#Voucher_Type").change(function() {
  9. var val = $(this).val();
  10. if(val === "Digital{y:voucher_email}") {
  11. $("#Email").show();
  12. }
  13. else if(val === "Print{y:voucher_print}") {
  14. $("#Email").hide();
  15. $('#Email').val('');
  16. }
  17. });
  18. });
  19.  
  20. $(function () {
  21. $("#Gift").change(function() {
  22. var val = $(this).val();
  23. if(val === "yes") {
  24. $("#gift_options").show();
  25. $("#shipto").prop('required',true);
  26. $("#Email").prop('required',true);
  27. $("#Notes").prop('required',true);
  28. }
  29. else if(val === "no") {
  30. $("#gift_options").hide();
  31. $('#shipto').val('');
  32. $('#Email').val('');
  33. $('#Notes').val('');
  34. $("#shipto").prop('required',false);
  35. $("#Email").prop('required',false);
  36. $("#Notes").prop('required',false);
  37. }
  38. });
  39. });
  40.  
  41. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement