On Feb 8, 10:11 am, Alexander Kojevnikov <alexan...@kojevnikov.com>
wrote:
> On Feb 8, 6:56 pm, niklasr <nikla...@gmail.com> wrote:
>
>
>
> > I'm looking for template tags or similar that according to http get
> > request parameters set the corresponding html form fields. To achieve
> > the selection of an html option and populate a textfield according to
> > the http request parameters where http get with two parameters should
> > prepopulate a textfield and the option selected in my html form /main?
> > q=foo&w=2 should set the textfield to 'foo' and the select option 2 to
> > state selected. I saw no template tag that directly tests or handles a
> > http get parameter but there probably is, for a more direct and
> > favorable way than passing the request parameters and testing option
> > by option
> >  <select>
> > ...
> > {% ifequal w "2" %}
> > <option selected  value="apples">Apples</option>
> > {% else %}
> > <option value="apples">Apples</option>
> >  {% endifequal %}
> > ...
> > Thank you
> > Niklas
>
> This is normally done using Django 
> forms:http://docs.djangoproject.com/en/dev/topics/forms/
Many thanks. I understand
google.appengine.ext.db.djangoforms.ModelForm or django.forms.Form or
just loop the options and set the selected, if only there was an
optionFromQuery value:
{% for currentOption in allOptions %} <option
value="{currentOption}" {% ifequal currentOption optionFromQuery %}
selected{% endifequal %}>{currentOption}</option>{% endfor %}
Best regards
Niklas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to