Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%[
- VAR @Text ,@Split1, @Split2, @Split3
- SET @rowset = LookupRows("raviDE","Email", "somemail@gmail.com")
- SET @row = Row(@rowset, 1)
- set @act=Field(@row,"subscrption")
- SET @Rows = BuildRowSetFromString(@act, ",")
- SET @Split1 = Field(Row(@Rows, 1), 1)
- SET @Split2 = Field(Row(@Rows, 2), 1)
- SET @Split3 = Field(Row(@Rows, 3), 1)
- if @Split1=="bed" then
- SET @acts= "checked"
- endif
- if @Split2=="clock" then
- SET @acts1= "checked"
- endif
- if @Split3=="phone" then
- SET @acts2= "checked"
- endif
- if @Split1==False then
- SET @act=""
- endif
- if @Split2==False then
- SET @act=""
- endif
- ]%%
- %%=v(@Split1)=%%</br>
- %%=v(@Split2)=%%</br>
- %%=v(@Split3)=%%</br>
- <form id="myForm" method="post" action="http://pages.S7.exacttarget.com/page.aspx?QS=38dfbe491fab00ea0ad4b925273e8608d40bab6a35b96d3428a16f6a0f519dc7">
- Email: <input type="text" name="test4" value="%%=Field(@row, "Email")=%%" /></br>
- Checkbox:<input type="checkbox" name="test5" value="bed" %%=v(@acts)=%%/> A Bed
- <input type="checkbox" name="test5" value="clock" %%=v(@acts1)=%%/> A Clock
- <input type="checkbox" name="test5" value="phone" %%=v(@acts2)=%%/> A phone
- <input type="submit" value="submit"/>
- </form
- %%[/* Modify to view AMPScript <div style="display:none"> */
- VAR @email, @Split1, @Split2, @Split3, @acts, @acts2, @acts3
- SET @rowset = LookupRows("raviDE","Email", "aomemail@gmail.com")
- SET @row = Row(@rowset, 1)
- set @email = "aomemail@gmail.com"
- if rowcount(@rowset) > 0 then
- set @email = Field(@row, "Email")
- endif
- set @act = Field(@row,"subscrption")
- SET @Rows = BuildRowSetFromString(@act, ",")
- set @rowCount = rowcount(@rows)
- output(concat("<br>@rowCount: ", @rowCount))
- set @split1 = ""
- set @split2 = ""
- set @split3 = ""
- set @acts = ""
- set @acts2 = ""
- set @acts3 = ""
- if @rowCount > 0 then
- if @rowCount >= 1 then
- SET @Split1 = Field(Row(@Rows, 1), 1)
- endif
- if @rowCount >= 2 then
- SET @Split2 = Field(Row(@Rows, 2), 1)
- endif
- if @rowCount >= 3 then
- SET @Split3 = Field(Row(@Rows, 3), 1)
- endif
- if @Split1 == "Seasonal travel information and trip ideas" then
- SET @acts= "checked"
- endif
- if @Split1 == "Travel Deals-monthly" then
- SET @acts1= "checked"
- endif
- if @Split1 == "Ski Deals Seasonal" then
- SET@acts2 = "checked"
- endif
- if @Split2 == "Seasonal travel information and trip ideas" then
- SET @acts= "checked"
- endif
- if @Split2 == "Travel Deals-monthly" then
- SET @acts1= "checked"
- endif
- if @Split2 == "Ski Deals Seasonal" then
- SET @acts2= "checked"
- endif
- if @Split3 == "Seasonal travel information and trip ideas" then
- SET @acts= "checked"
- endif
- if @Split3 == "Travel Deals-monthly" then
- SET @acts1= "checked"
- endif
- if @Split3 == "Ski Deals Seasonal" then
- SET @acts2= "checked"
- endif
- endif
- /*</div>*/
- ]%%
- <br>%%=v(@Split1)=%%
- <br>%%=v(@Split2)=%%
- <br>%%=v(@Split3)=%%
- <form id="myForm" method="post" action="http://pages.S7.exacttarget.com/page.aspx?QS=38dfbe491fab00ea0ad4b925273e8608d40bab6a35b96d3428a16f6a0f519dc7">
- <br>Email: <input type="text" name="test4" value="%%=v(@email)=%%" />
- <br>Checkbox:<input type="checkbox" name="test5" value="Seasonal travel information and trip ideas" %%=v(@acts)=%%/> Seasonal travel information and trip ideas
- <br><input type="checkbox" name="test5" value="Travel Deals-monthly" %%=v(@acts1)=%%/> Travel Deals-monthly
- <br><input type="checkbox" name="test5" value="Ski Deals Seasonal" %%=v(@acts2)=%%/> Ski Deals Seasonal
- <br><input type="submit" value="submit"/>
- </form>
- Here I am using lot of If conditions in these lines:
- if @Split1 == "Seasonal travel information and trip ideas" then
- SET @acts= "checked"
- endif
- if @Split1 == "Travel Deals-monthly" then
- SET @acts1= "checked"
- endif
- if @Split1 == "Ski Deals Seasonal" then
- SET@acts2 = "checked"
- endif
- if @Split2 == "Seasonal travel information and trip ideas" then
- SET @acts= "checked"
- endif
- if @Split2 == "Travel Deals-monthly" then
- SET @acts1= "checked"
- endif
- if @Split2 == "Ski Deals Seasonal" then
- SET @acts2= "checked"
- endif
- if @Split3 == "Seasonal travel information and trip ideas" then
- SET @acts= "checked"
- endif
- if @Split3 == "Travel Deals-monthly" then
- SET @acts1= "checked"
- endif
- if @Split3 == "Ski Deals Seasonal" then
- SET @acts2= "checked"
- endif
- %%[
- VAR @email, @Split1, @Split2, @Split3, @acts, @acts2, @acts3
- SET @rowset = LookupRows("raviDE","Email", "somemail@gmail.com")
- SET @row = Row(@rowset, 1)
- set @email = ""
- if rowcount(@row) > 0 then
- set @email = Field(@row, "Email")
- endif
- set @act = Field(@row,"subscrption")
- SET @Rows = BuildRowSetFromString(@act, ",")
- set @rowCount = rowcount(@rows)
- output(concat("<br>@rowCount: ", @rowCount))
- set @split1 = ""
- set @split2 = ""
- set @split3 = ""
- set @acts = ""
- set @acts2 = ""
- set @acts3 = ""
- if @rowCount > 0 then
- if @rowCount >= 1 then
- SET @Split1 = Field(Row(@Rows, 1), 1)
- endif
- if @rowCount >= 2 then
- SET @Split2 = Field(Row(@Rows, 2), 1)
- endif
- if @rowCount >= 3 then
- SET @Split3 = Field(Row(@Rows, 3), 1)
- endif
- if @Split1 == "bed" then
- SET @acts= "checked"
- endif
- if @Split2 == "clock" then
- SET @acts1= "checked"
- endif
- if @Split3 == "phone" then
- SET @acts2= "checked"
- endif
- endif
- ]%%
- <br>%%=v(@Split1)=%%
- <br>%%=v(@Split2)=%%
- <br>%%=v(@Split3)=%%
- <form id="myForm" method="post" action="http://pages.S7.exacttarget.com/page.aspx?QS=38dfbe491fab00ea0ad4b925273e8608d40bab6a35b96d3428a16f6a0f519dc7">
- <br>Email: <input type="text" name="test4" value="%%=v(@email)=%%" />
- <br>Checkbox:<input type="checkbox" name="test5" value="bed" %%=v(@acts)=%%/> A Bed
- <br><input type="checkbox" name="test5" value="clock" %%=v(@acts1)=%%/> A Clock
- <br><input type="checkbox" name="test5" value="phone" %%=v(@acts2)=%%/> A phone
- <br><input type="submit" value="submit"/>
- </form>
Add Comment
Please, Sign In to add comment