Hey Guys. I'm fairly new to TG so please bear with  me.

Here is the code i use:

#My Controller file:

formFields = [widgets.SingleSelectField("special_program",
 
options=getSpecialPrograms(),
 
default='E',label="Special Program:")]

the_form = widgets.TableForm(
    name="add",
    formFields,
    values = "",
    submit_text="Save",
    action="save",
    )

@expose(template=".templates.form")
def index(self,tg_errors=None, tg_exceptions=None):
   return dict(form=the_form,action="/save")

@expose()
def save(self, **posted):
   return dict(data = posted)

# My template file:
${form(action=action, method="POST")}

Now this works fine. This is the HTML code i get when i render the
form:

<form action="/save" method="POST" class="tableform" name="add">
<td>
        <select id="add_special_program" name="special_program"
class="singleselectfield">
               <option value="JE">Jewish</option><option
value="CA">Catholic</option><option selected value="E">Empty</option>
        </select>
</td>
</form>

Now here is my dilemma. When i submit the form and get the posted
data, instead of getting the values of my selection(ie: JE,CA,E) i get
the actual text in the options(ie: Jewish, Catholic,Empty). How can i
retrieve the value of the option in the <select> tag as oppose to the
text?

Thanks for your time.
And again, sorry if it's a stupid question with an obvious solution.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to