iRev Form Question

Jim Ault jimaultwins at yahoo.com
Thu Apr 14 15:05:06 EDT 2011


On Apr 14, 2011, at 11:41 AM, RevList wrote:

> I have to admit that I seldom use my on-rev acoount and have just  
> been using it to host some mailto form submissions.
> This has all worked well for me for a basic form submission when the  
> form just has text entry boxes
> I store the entered data into the rev variable using <?rev put  
> VarName ?>
>
> Like this
> <input type="text" name="email" size="50" maxlength="80"  value="<? 
> rev put tEmail ?>" />
>
> Now, I am the first to admit, I know only enough about form creation  
> on html and On-rev to be dangerous.
>
> Now, I need to add a new selection field to my form and store that  
> data in tSal
>
> I don't know how to do this.
>
> To create the selection list, I use
> <SELECT name="Salution" >
> <OPTION selected value="">-- Please Select --</OPTION><OPTION  
> value=Mr>Mr</OPTION><OPTION value=Mrs>Mrs</OPTION><OPTION  
> value=Ms>Ms</OPTION></SELECT>
>
> Where do I put <?rev put tSal ?>
>
> Thanks in advance for anyone who can answer this.  I am under the  
> gun to complete this project and can't find any quick reference to  
> solve this for me.


I would think you want to add another choice for the user that is the  
stored data value.
Caution, what if tSal is empty ??

     (note: HTML ignores CR chars)
<SELECT name="Salution" >
<OPTION selected value="">-- Please Select --</OPTION>
<OPTION value="<?rev put tSal ?>"><?rev put tSal ?></OPTION>
<OPTION value=Mr>Mr</OPTION>
<OPTION value=Mrs>Mrs</OPTION>
<OPTION value=Ms>Ms</OPTION>

</SELECT>

You could add an IF to skip in the case of empty.

if tSal is not empty then put <OPTION value="<?rev put tSal ?>"><?rev  
put tSal ?></OPTION>

Hope this works for you.  At least this should get you close to the  
correct solution.
(not tested, but it looks OK )

Jim Ault
Las Vegas






More information about the use-livecode mailing list