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
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!