Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mo 34 posts 54 karma points
    May 11, 2010 @ 12:16
    Mo
    0

    Contour question: infinite fields ..?

    Hi, big fan of umbraco - been xslt'ing for about 3 months now.

     

    I'm thinking of getting Contour today, but for my current project I have a requirement I'm not sure if Contour can accommodate:

    I need to implement forms with infinite fields. By that I mean a form where an end user filling in such a form would have the ability to add more fields if he/she has more information to add.

    Something like this:

    Education: --------------------

    [add more]

    and the "add more" button adds a new Education field.

     

    I have no problem hardcoding such a form, but the client I'm developing for wants to have this functionality in user created forms as well.

    Contour is a great solution for allowing cms users to add new forms, but it would be even better if there is support for infinite fields.

  • Comment author was deleted

    May 11, 2010 @ 13:35

    Hi Mo,

    It should be possible to create a custom fieldtype that has this behaviour.

    So a textbox with an 'add more' option that would add additional textboxes. The value of that field would then be stored as a comma seperated list of the different entries.

    To get started you can find the sourcecode off all default Contour components (including field types) here:

    http://our.umbraco.org/projects/umbraco-contour-shared-source

     

  • Mo 34 posts 54 karma points
    May 11, 2010 @ 14:05
    Mo
    0

    Thanks for the tip Tim, but what if the user entered a comma? that... could pose a problem!

     

    I'm thinking of trying a simplified approach where a maximum of 5 fields can be added, and then fill in the 6 table fields. Can a data type have multiple table fields?

     

    On a tangent: are there measures implemented into contour to prevent sql injection?

  • Per Ploug Hansen 208 posts 129 karma points
    May 14, 2010 @ 13:27
    Per Ploug Hansen
    0

    Hi Mo

    A field can only have 1 table field, there are currently no way around this limitation, we are looking into a soluton. 

    Data operations follow the Microsoft Patterns and Practices guidelines to avoid injection. 

    /Per

  • Mo 34 posts 54 karma points
    May 24, 2010 @ 17:43
    Mo
    0

    what kind of separator caan I use that wouldn't conflict with commas, colons, semicolons or periods?

     

    The data entered could have all these and I am trying to figure out a method where nothing gets corrupted.

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    May 24, 2010 @ 18:01
    Tim
    0

    You could use something pretty unlikely to see real world use, such as ~, to make it even less likely to conflict, double, or triple it up, ie ~~ or ~~~

Please Sign in or register to post replies

Write your reply to:

Draft