Why does my nested_name get added to the beginning of every field created by my repeatable element? The documentation doesn't mention that. I'll give more code than I think I need to in case it is something I am doing.

This part of my edit.yml file:

id: form
auto_id: %n

(further down)

       - type: Repeatable
         nested_name: codename
         increment_field_names: 1
         attributes:
           class: repeating
         model_config:
           delete_if_true: deletion_marker
           new_empty_row_multi: name

         element:
           - type: Block
             tag: TR
             attributes:
               align: center

             element:
               - type: Block
                 tag: TD

                 element:
                   - type: Hidden
                     name: codename_id

                   - type: Text
                     name: name
                     constraints:
                     - type: Length
                       min: 4
                       message: Must be at least 4 characters long.

               - type: Block
                 tag: TD

                 element:
                   - type: Checkbox
                     name: deletion_marker

       - type: Hidden
         name: count
         constraints:
           - type: Range
             max: 3


Gives these results.

<div class="repeating">
<TR align="center">
<TD>
<input name="codename.codename_id_1" type="hidden" value="3" 
id="codename.codename_id_1" />
<div class="text">
<input name="codename.name_1" type="text" value="Piglet" id="codename.name_1" />
</div>
</TD>
<TD>
<div class="checkbox">
<input name="codename.deletion_marker_1" type="checkbox" value="1" 
id="codename.deletion_marker_1" />
</div>
</TD>
</TR>
</div>
<div class="repeating">
<TR align="center">

<TD>
<input name="codename.codename_id_2" type="hidden" value="5" 
id="codename.codename_id_2" />
<div class="text">
<input name="codename.name_2" type="text" value="Dreamweaver" id="codename.name_2" 
/>
</div>
</TD>
<TD>
<div class="checkbox">
<input name="codename.deletion_marker_2" type="checkbox" value="1" 
id="codename.deletion_marker_2" />
</div>
</TD>
</TR>
</div>


Why is there the "codename." before everything? If I remove the auto_id: %n or change it to %r, it doesn't seem to affect anything. Am I supposed to set %n myself? I suspect that it is what is messing up my has_many writes because my many-to-many works.

_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to