Gossamer Forum
Home : Products : Gossamer Links : Discussions :

if Newsletter eq

Quote Reply
if Newsletter eq
Why this not work?

<select name="Newsletter">

<option value="No" <%if Newsletter eq No%>selected<%endif%>>No</option>
<option value="Yes" <%if Newsletter eq Yes%>selected<%endif%>>Yes</option>

</select>

Trying to make the default select based on whats already in the user prefernce.

(Im using the ChangeInfo plugin to retrieve the date)

--------------------------------
Privacy Software

Last edited by:

BLOOD: Jan 26, 2003, 4:47 AM
Quote Reply
Re: [BLOOD] if Newsletter eq In reply to
Try using quotes, i.e.

<%if Newsletter eq 'Yes'%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] if Newsletter eq In reply to
Hi thanks,

I'm sure I have the logic correct here but it do not select the correct one, instead just goes to No.

Putting in <%Newsletter%> on its own gives the correct output No or Yes, so I donít see why this wouldn't work!

<option value="No" <%if Newsletter eq 'No'%>selected<%endif%>>No</option>
<option value="Yes" <%if Newsletter eq 'Yes'%>selected<%endif%>>Yes</option>

--------------------------------
Privacy Software
Quote Reply
Re: [yogi] if Newsletter eq In reply to
Ahh - I see the problem.

XHTML requires the select to be: selected="selected" wich is what i used. Just using selected as the example above is ok.

links is doing something else with that and removing the tag completely.

--------------------------------
Privacy Software

Last edited by:

BLOOD: Jan 26, 2003, 6:11 AM