Guest User

Untitled

a guest
Oct 30th, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.94 KB | None | 0 0
  1. %%[
  2.  
  3. VAR @Text ,@Split1, @Split2, @Split3
  4.  
  5. SET @rowset = LookupRows("raviDE","Email", "somemail@gmail.com")
  6. SET @row = Row(@rowset, 1)
  7. set @act=Field(@row,"subscrption")
  8. SET @Rows = BuildRowSetFromString(@act, ",")
  9.  
  10. SET @Split1 = Field(Row(@Rows, 1), 1)
  11. SET @Split2 = Field(Row(@Rows, 2), 1)
  12. SET @Split3 = Field(Row(@Rows, 3), 1)
  13.  
  14. if @Split1=="bed" then
  15. SET @acts= "checked"
  16. endif
  17. if @Split2=="clock" then
  18. SET @acts1= "checked"
  19. endif
  20. if @Split3=="phone" then
  21. SET @acts2= "checked"
  22. endif
  23. if @Split1==False then
  24. SET @act=""
  25. endif
  26. if @Split2==False then
  27. SET @act=""
  28. endif
  29.  
  30. ]%%
  31. %%=v(@Split1)=%%</br>
  32. %%=v(@Split2)=%%</br>
  33. %%=v(@Split3)=%%</br>
  34.  
  35.  
  36. <form id="myForm" method="post" action="http://pages.S7.exacttarget.com/page.aspx?QS=38dfbe491fab00ea0ad4b925273e8608d40bab6a35b96d3428a16f6a0f519dc7">
  37. Email: <input type="text" name="test4" value="%%=Field(@row, "Email")=%%" /></br>
  38. Checkbox:<input type="checkbox" name="test5" value="bed" %%=v(@acts)=%%/> A Bed
  39. <input type="checkbox" name="test5" value="clock" %%=v(@acts1)=%%/> A Clock
  40. <input type="checkbox" name="test5" value="phone" %%=v(@acts2)=%%/> A phone
  41.  
  42. <input type="submit" value="submit"/>
  43. </form
  44.  
  45. %%[/* Modify to view AMPScript <div style="display:none"> */
  46. VAR @email, @Split1, @Split2, @Split3, @acts, @acts2, @acts3
  47. SET @rowset = LookupRows("raviDE","Email", "aomemail@gmail.com")
  48. SET @row = Row(@rowset, 1)
  49. set @email = "aomemail@gmail.com"
  50. if rowcount(@rowset) > 0 then 
  51.   set @email = Field(@row, "Email")
  52. endif
  53. set @act = Field(@row,"subscrption")
  54. SET @Rows = BuildRowSetFromString(@act, ",")
  55. set @rowCount = rowcount(@rows) 
  56. output(concat("<br>@rowCount: ", @rowCount))
  57. set @split1 = ""
  58. set @split2 = ""
  59. set @split3 = ""
  60. set @acts = ""
  61. set @acts2 = ""
  62. set @acts3 = ""
  63. if @rowCount > 0 then
  64.   if @rowCount >= 1 then
  65.     SET @Split1 = Field(Row(@Rows, 1), 1)
  66.   endif 
  67.   if @rowCount >= 2 then
  68.     SET @Split2 = Field(Row(@Rows, 2), 1)
  69.   endif 
  70.   if @rowCount >= 3 then
  71.     SET @Split3 = Field(Row(@Rows, 3), 1)
  72.   endif 
  73.   if @Split1 == "Seasonal travel information and trip ideas"  then
  74.       SET @acts= "checked" 
  75.   endif
  76.   if @Split1 == "Travel Deals-monthly"  then
  77.       SET @acts1= "checked" 
  78.   endif
  79. if @Split1 == "Ski Deals Seasonal"  then
  80.       SET@acts2 = "checked" 
  81.   endif
  82.  if @Split2 == "Seasonal travel information and trip ideas"  then
  83.       SET @acts= "checked" 
  84.   endif
  85.   if @Split2 == "Travel Deals-monthly"  then
  86.       SET @acts1= "checked" 
  87.   endif
  88. if @Split2 == "Ski Deals Seasonal"  then
  89.       SET @acts2= "checked" 
  90.   endif
  91.  if @Split3 == "Seasonal travel information and trip ideas"  then
  92.       SET @acts= "checked" 
  93.   endif
  94.   if @Split3 == "Travel Deals-monthly"  then
  95.       SET @acts1= "checked" 
  96.   endif
  97.   if @Split3 == "Ski Deals Seasonal"  then
  98.       SET @acts2= "checked" 
  99.   endif
  100. endif
  101. /*</div>*/
  102. ]%%
  103. <br>%%=v(@Split1)=%%
  104. <br>%%=v(@Split2)=%%
  105. <br>%%=v(@Split3)=%%
  106. <form id="myForm" method="post" action="http://pages.S7.exacttarget.com/page.aspx?QS=38dfbe491fab00ea0ad4b925273e8608d40bab6a35b96d3428a16f6a0f519dc7">
  107. <br>Email: <input type="text" name="test4" value="%%=v(@email)=%%" />
  108. <br>Checkbox:<input type="checkbox" name="test5" value="Seasonal travel information and trip ideas"  %%=v(@acts)=%%/> Seasonal travel information and trip ideas
  109. <br><input type="checkbox" name="test5" value="Travel Deals-monthly" %%=v(@acts1)=%%/> Travel Deals-monthly
  110. <br><input type="checkbox" name="test5" value="Ski Deals Seasonal" %%=v(@acts2)=%%/> Ski Deals Seasonal
  111. <br><input type="submit" value="submit"/>
  112. </form>
  113. Here I am using lot of If conditions in these lines:
  114.  
  115. if @Split1 == "Seasonal travel information and trip ideas"  then
  116.       SET @acts= "checked" 
  117.   endif
  118.   if @Split1 == "Travel Deals-monthly"  then
  119.       SET @acts1= "checked" 
  120.   endif
  121. if @Split1 == "Ski Deals Seasonal"  then
  122.       SET@acts2 = "checked" 
  123.   endif
  124.  if @Split2 == "Seasonal travel information and trip ideas"  then
  125.       SET @acts= "checked" 
  126.   endif
  127.   if @Split2 == "Travel Deals-monthly"  then
  128.       SET @acts1= "checked" 
  129.   endif
  130. if @Split2 == "Ski Deals Seasonal"  then
  131.       SET @acts2= "checked" 
  132.   endif
  133.  if @Split3 == "Seasonal travel information and trip ideas"  then
  134.       SET @acts= "checked" 
  135.   endif
  136.   if @Split3 == "Travel Deals-monthly"  then
  137.       SET @acts1= "checked" 
  138.   endif
  139.   if @Split3 == "Ski Deals Seasonal"  then
  140.       SET @acts2= "checked" 
  141.   endif
  142.  
  143. %%[
  144.  
  145. VAR @email, @Split1, @Split2, @Split3, @acts, @acts2, @acts3
  146.  
  147. SET @rowset = LookupRows("raviDE","Email", "somemail@gmail.com")
  148. SET @row = Row(@rowset, 1)
  149.  
  150. set @email = ""
  151. if rowcount(@row) > 0 then
  152. set @email = Field(@row, "Email")
  153. endif
  154.  
  155. set @act = Field(@row,"subscrption")
  156. SET @Rows = BuildRowSetFromString(@act, ",")
  157. set @rowCount = rowcount(@rows)
  158.  
  159. output(concat("<br>@rowCount: ", @rowCount))
  160.  
  161. set @split1 = ""
  162. set @split2 = ""
  163. set @split3 = ""
  164. set @acts = ""
  165. set @acts2 = ""
  166. set @acts3 = ""
  167.  
  168. if @rowCount > 0 then
  169.  
  170. if @rowCount >= 1 then
  171. SET @Split1 = Field(Row(@Rows, 1), 1)
  172. endif
  173.  
  174. if @rowCount >= 2 then
  175. SET @Split2 = Field(Row(@Rows, 2), 1)
  176. endif
  177.  
  178. if @rowCount >= 3 then
  179. SET @Split3 = Field(Row(@Rows, 3), 1)
  180. endif
  181.  
  182. if @Split1 == "bed" then
  183. SET @acts= "checked"
  184. endif
  185. if @Split2 == "clock" then
  186. SET @acts1= "checked"
  187. endif
  188. if @Split3 == "phone" then
  189. SET @acts2= "checked"
  190. endif
  191.  
  192. endif
  193.  
  194.  
  195. ]%%
  196. <br>%%=v(@Split1)=%%
  197. <br>%%=v(@Split2)=%%
  198. <br>%%=v(@Split3)=%%
  199.  
  200. <form id="myForm" method="post" action="http://pages.S7.exacttarget.com/page.aspx?QS=38dfbe491fab00ea0ad4b925273e8608d40bab6a35b96d3428a16f6a0f519dc7">
  201. <br>Email: <input type="text" name="test4" value="%%=v(@email)=%%" />
  202. <br>Checkbox:<input type="checkbox" name="test5" value="bed" %%=v(@acts)=%%/> A Bed
  203. <br><input type="checkbox" name="test5" value="clock" %%=v(@acts1)=%%/> A Clock
  204. <br><input type="checkbox" name="test5" value="phone" %%=v(@acts2)=%%/> A phone
  205. <br><input type="submit" value="submit"/>
  206. </form>
Add Comment
Please, Sign In to add comment