Formulator--pre-selecting a line in a multiline field
Dear Dieter, Thank you for answering my Formulator question. I am a little unclear on your answer. If I may I would like to ask it more clearly. In a DTML document, I have the following code to render the field "company_contact_id" which is an integer, and its label, inside a table for formatting: <tr> <td><dtml-var "profile_form.company_contact_id.get_value('title')"></td> <td><dtml-var "profile_form.company_contact_id.render(_['company_contact_id'])"></td> </tr> In this case, the field in the database is called "company_contact_id", and that is also what I named it in Formulator. In your example you said: <INPUT TYPE="HIDDEN" NAME="sex_code:int" VALUE="<dtml-var sex_code null="">"> I have read the database record before I display the page and I have the values in the record, I am able to display other "fixed" fields. I am not sure how your example fits with pre-setting the Formulator field on display. In other Formulator fields, including the database field name as (_['company_contact_id']) works to preview the value from the database record. But in the case of the list field, it does not work. Are you suggesting that I should create a hidden field and assign it the value I want to select -- and then refer to that hidden field as the default value of the Formulator multiline widget? Does the Formulator rendering code understand how to do that with a multilist field? Thanks for your help. David ======================================= David T. Washburn DWashburn@AmInfo.com Amherst, MA USA 413 256-3103
Hello David
Are you suggesting that I should create a hidden field and assign it the value I want to select -- and then refer to that hidden field as the default value of the Formulator multiline widget? Does the Formulator rendering code understand how to do that with a multilist field?
Yes, exactly. When you put the value in the hidden field of the form, it will be in the REQUEST of the formulator form. The magic of formulator puts then the selected="selected" HTML stuff. This even works with MultiListFields. Regards Dieter
participants (2)
-
David Washburn -
Dieter Fischer