For simple input fields, I'm echoing back the data from database to
form like this:

<p>Your Domain (example: JohnDoe.com) <br/><br />
<input type="text" name="domain"
{%if session.domain%} value="{{session.domain}}" {%else%}
value=""{%endif%}  size="40" />
</p>

If I don't put the "if" statement there, I get the value "None"
appearing, which is not desireable from a user's perspective.  In this
case "session" is the name of database/table/model.

That seems to work fine, but what about a <Select> statement that for
example has all 50 states of the USA.
That would be a lot of template coding if I try to do the same was as
above


<select id="state" name="state">
<option value="AK">Alaska</option>
etc...

I'm assuming this would work - but very tedious to do this for all 50
states.
<option value="AK" {% ifequal state "AK"%} selected {% endifequal %}
>Alaska</option>

Is there a widget or something that will do it for me?

Thanks,
Neal Walters


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to