Malcolm,
I've created a new form field:

seen_updates = forms.IntegerField(widget=forms.HiddenInput)

I've added the form field to my checkout page:

<form method="post" action="/plush/cart/checkout/">
      {{ fo.seen_updates }}

How do I assign it a value of 0 for when the sales tax has not been
shown, and a 1 for when the sales tax message has been shown?



On Oct 14, 6:45 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-10-14 at 16:24 -0700, Greg wrote:
> > Malcolm,
> > Can you please show me how I would use hidden fields to let me know
> > that the user has seen the updated price?
>
> There's a newforms widget called HiddenInput. So if your form has a
> field called, say, "seen_updates", make sure you create it with
> widget=HiddenInput. Then the field won't be rendered visibly on the
> form, but you'll still get back the value from it when the form is
> submitted.
>
> So, on the first presentation of the form, seen_updates might be 0 (if
> you're using an integer field for it) and then the second time around,
> it will be 1. That way, your form processing code only has to check this
> one form variable to see if it needs to represent the form with the
> sales tax added.
>
> Does that clear things up a bit?
>
> Regards,
> Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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