Advertisement
Guest User

Untitled

a guest
May 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.21 KB | None | 0 0
  1. //on click
  2. $(document).on('click', '.add', function(){
  3. //Loop for repeat index
  4. for (var repeat_index=0; repeat_index < window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value').length; repeat_index++ ) {
  5. //Looop for component data
  6. for ( var i_component = 0; i_component < window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index].length; i_component++ ) {
  7. //Check if type is Salesforce and null value or no value available
  8. if ( window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index][i_component].type == "Salesforce" ) {
  9. if ( window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index][i_component].value ) {
  10. //Get component_id
  11. var component_id = window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index][7].component_id;
  12. //Update UI based on component id.
  13. $("#collapse_c47a-5772-e40f_"+repeat_index+" #component-"+component_id+" .input_content").val('Requested by Grower');
  14. //Set value in repeat group
  15. window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index][7].value = 'Requested by Grower'
  16. } else {
  17. console.log('No Exist')
  18. //Get component_id
  19. var component_id = window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index][7].component_id;
  20. //Update UI based on component id.
  21. $("#collapse_c47a-5772-e40f_"+repeat_index+" #component-"+component_id+" .input_content").val('Forecasted');
  22. //Set value in repeat group
  23. window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index][7].value = 'Forecasted'
  24. }
  25. }
  26. }
  27. }
  28. })
  29.  
  30. //on click
  31. $(document).on('click', '.add', function(){
  32. //Loop for repeat index
  33. for (var repeat_index=0; repeat_index < window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value').length; repeat_index++ ) {
  34. //Looop for component data
  35. for ( var i_component = 0; i_component < window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index].length; i_component++ ) {
  36. //Check if type is Salesforce and null value or no value available
  37. if ( window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index][i_component].type == "Salesforce" ) {
  38. if ( window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index][i_component].value ) {
  39. //Get component_id
  40. var component_id = window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index][8].component_id;
  41. //Update UI based on component id.
  42. $("#collapse_879f-f484-fcb7_"+repeat_index+" #component-"+component_id+" .input_content").val('Requested by Grower');
  43. //Set value in repeat group
  44. window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index][8].value = 'Requested by Grower'
  45. } else {
  46. console.log('No Exist')
  47. //Get component_id
  48. var component_id = window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index][8].component_id;
  49. //Update UI based on component id.
  50. $("#collapse_879f-f484-fcb7_"+repeat_index+" #component-"+component_id+" .input_content").val('Forecasted');
  51. //Set value in repeat group
  52. window.formyoula.form_fields["879f-f484-fcb7"].get('repeat_value')[repeat_index][8].value = 'Forecasted'
  53. }
  54. }
  55. }
  56. }
  57. })
  58.  
  59. //on click
  60. $(document).on('click', '.add', function(){
  61. //Loop for repeat index
  62. for (var repeat_index=0; repeat_index < window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value').length; repeat_index++ ) {
  63. //Looop for component data
  64. for ( var i_component = 0; i_component < window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index].length; i_component++ ) {
  65. //Check if type is Salesforce and null value or no value available
  66. if ( window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index][i_component].type == "Salesforce" ) {
  67. if ( window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index][i_component].value ) {
  68. //Get component_id
  69. var component_id = window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index][7].component_id;
  70. //Update UI based on component id.
  71. $("#collapse_ee5e-5329-fcbb_"+repeat_index+" #component-"+component_id+" .input_content").val('Requested by Grower');
  72. //Set value in repeat group
  73. window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index][7].value = 'Requested by Grower'
  74. } else {
  75. console.log('No Exist')
  76. //Get component_id
  77. var component_id = window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index][7].component_id;
  78. //Update UI based on component id.
  79. $("#collapse_ee5e-5329-fcbb_"+repeat_index+" #component-"+component_id+" .input_content").val('Forecasted');
  80. //Set value in repeat group
  81. window.formyoula.form_fields["ee5e-5329-fcbb"].get('repeat_value')[repeat_index][7].value = 'Forecasted'
  82. }
  83. }
  84. }
  85. }
  86. })
  87.  
  88. //on click
  89. $(document).on('click', '.add', function(){
  90. //Loop for repeat index
  91. for (var repeat_index=0; repeat_index < window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value').length; repeat_index++ ) {
  92. //Looop for component data
  93. for ( var i_component = 0; i_component < window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index].length; i_component++ ) {
  94. //Check if type is Salesforce and null value or no value available
  95. if ( window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index][i_component].type == "Salesforce" ) {
  96. if ( window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index][i_component].value ) {
  97. //Get component_id
  98. var component_id = window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index][9].component_id;
  99. //Update UI based on component id.
  100. $("#collapse_e92d-cd8a-aabe_"+repeat_index+" #component-"+component_id+" .input_content").val('Requested by Grower');
  101. //Set value in repeat group
  102. window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index][9].value = 'Requested by Grower'
  103. } else {
  104. console.log('No Exist')
  105. //Get component_id
  106. var component_id = window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index][9].component_id;
  107. //Update UI based on component id.
  108. $("#collapse_e92d-cd8a-aabe_"+repeat_index+" #component-"+component_id+" .input_content").val('Forecasted');
  109. //Set value in repeat group
  110. window.formyoula.form_fields["e92d-cd8a-aabe"].get('repeat_value')[repeat_index][9].value = 'Forecasted'
  111. }
  112. }
  113. }
  114. }
  115. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement