Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Select List: Can't seem to get it right.

Quote Reply
Select List: Can't seem to get it right.
For some reason Im struggling with selection lists in the include.form.html template

I have:
Code:
<div class="value">
<select name="listingstatus" size="1">
<option <%if listingstatus eq ""%>value="On" selected="selected" <%endif%>>On</option>
<option <%if listingstatus eq "Off"%>selected="selected" value="Off" <%endif%>>Off</option>
<option <%if listingstatus eq "On"%>selected="selected" value="On" <%endif%>>On</option>
</select>
</div>

But no matter what link I go to modify, it always starts off with the value selected of Off even if the value is On for that link record.

Am I writing this wrong?
Quote Reply
Re: [Westin] Select List: Can't seem to get it right. In reply to
Try this:

Code:
<select name="listingstatus" size="1">
<option <%if not listingstatus or listingstatus eq "Off"%>selected="selected"<%endif%> value="Off">Off</option>
<option <%if listingstatus eq "On"%>selected="selected"<%endif%> value="On" >On</option>
</select>

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates