Re: Newbie: How to use object related to dropdown selection in django/javascript spaguetti code?

2009-09-14 Thread Samuel Lerning
Hi again, Some progress here, but a minor problem remaining. On selecting a foo, the page is re-rendered with the correct data related to the selected foo. However, the selection list (dropdown) always shows the name of the first foo, instead of showing the name of the selected foo. And I need

Re: Newbie: How to use object related to dropdown selection in django/javascript spaguetti code?

2009-09-14 Thread Samuel Lerning
Hi, Thank you so much Serafim! I think this is the right direction. And that was a nice tip. :) However, now, everytime I select a different foo from the list, a blank page with a number (that I think is the id from the foo object) is rendered. At the moment, the view code has the following

Re: Newbie: How to use object related to dropdown selection in django/javascript spaguetti code?

2009-09-13 Thread Tiago Serafim
Hi, First you should have an attribute "name" on your select. It's needed to pass the value when the form is submitted. If your select's name is "foos_combo", then your code you'll look like this: def foo_relatory(request): if request.method == 'POST': foos_combo =

Newbie: How to use object related to dropdown selection in django/javascript spaguetti code?

2009-09-13 Thread Samuel Lerning
Hello, I'm a newbie struggling with a simple problem for some time now. I know it is a simple problem and it is a shame that I don't know how to solve it. I have a django spaguetti code that, instead of using forms, uses javascript functions to get a selection from a selection list (). Since I