[AWS] Default values in drop-down using template parser
Alejandro R. Mosteo
alejandro at mosteo.com
Thu Dec 16 17:52:26 CET 2004
Alejandro R. Mosteo wrote:
> Björn Lundin wrote:
>
>> Hi!
>> I'm using (or actually a colleuge of mine) AWS 1.4 on Aix
>> to develop some kind of web-application (not done yet, but when so
>> I'll notify Pascal, and tell him AWS works on Aix 4.3.3 and Aix 5.2)
>>
>> We use the template parser, and return a page with a drop-down list in
>> it,
>> The user is supposed to select a value from the list, and do some
>> action (post or get) to the server. Then the same page is returned to
>> the user, but this time, we want to set the value selected from the
>> drop-down last time, as the default value. The value we picked last
>> time is saved via the session object.
>>
>> So what I look for, is some example code to set a default value to a
>> drop down list using the template parser.
>
>
> I can't provide details right now, but the default in a drop-down is
> marked using "selected" after the option. So, assuming you're using a
> @@TABLE@@ to enumerate the options in the drop-down, you can add a
> variable after the option, which will have "" for unselected options and
> "selected" for the one selected.
Supposing you have a static set of options in the drop-down, and you're
not using a @@TABLE@@ for these, you can use this direct approach:
http://deepsix.homeip.net/svn/Adagio%20head/src/html/config.html
(look for the "selected" word).
Otherwise the strategy I outline in my other mail should work.
Kind regards,
A. Mosteo.
More information about the AWS
mailing list