Hi,

this is how we do it, when you initial the Form object, you can add
"inital" values". ignore the request.session in there that isjust
where we stored values if the user goes back and forth in multiple
forms.
the 1st '' part is the form element.

     form = BookingFormOne(initial={
          'u_1stline': request.session['u_1stline'],
          'u_2ndline': request.session['u_2ndline'],
          'u_city': request.session['u_city'],
      }

On Apr 5, 10:11 pm, Matias Surdi <[EMAIL PROTECTED]> wrote:
> Matias Surdi escribió:
>
>
>
> > Hi.
>
> > How can I pass an initial value to a newforms form's widget?
>
> > I know that there is an "initial" parameter for widgets, but what if I
> > don't know that parameter's value beforehand?
>
> > What I'm trying to do is to be able to make a request to an url and
> > depending on some url parameters generate a form wich will take its
> > initial values from those url parameters.
>
> > Any idea?
>
> > Thanks a lot.
>
> I think what I was looking for is this:
>
>  >>> MyForm.base_fields["url"].initial="http://www.url.com";
>
> Could this cause any problem? Is this the correct way to do this?
>
> Thanks for your help.
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to