Copied to clipboard

Flag this post as spam?

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


  • Lars Nederberg 29 posts 84 karma points
    Feb 05, 2011 @ 14:03
    Lars Nederberg
    0

    Radiobutton list with name/value

    Hi

    Did anyone make a custom datatype/radiobuttonlist where you can specify name and value.
    Need the value to be able to run statistic calculations against the entries.

    I will reward the person that can help me on this!

     

  • Comment author was deleted

    Feb 10, 2011 @ 10:04

    Hi Lars,

    If you take a look at the contour shared sourcecode you can see the source for the details radiobutton list fieldtype, it should be pretty easy to start from this and adjust it to your needs

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

    Cheers,
    Tim

  • Lars Nederberg 29 posts 84 karma points
    Feb 10, 2011 @ 13:27
    Lars Nederberg
    0

    Thanks Tim!

    I managed to get one step closer.

    Now i created a new fieldtype and added a field in the "PreValueModal" in EditForm.ascx.

    How do i hook in that value to my new class with the new fieldtype?

    / br Lars

  • Lars Nederberg 29 posts 84 karma points
    Feb 11, 2011 @ 09:58
    Lars Nederberg
    0

    My tacky solution! :)

    1. Created a new fieldtype. Started of from RadioButtonList.cs from the shared sourcecode

    2. Added a text input field for the value in the modal for editing prevalues(id="PreValueModal") that is found under /usercontrols/umbracoContour/EditForm.ascx

    3. Changed in the umbracoforms.js. JQuery to add the value in the prevalues as the sting text=value

    4. In fieldtype i split the text  (text=value).split("=") and then use one as result[0] as the text and result[1] as the value.

    This renders the form right and stores the entry with the value. The only thing i could not get to work yet is edit the entry.

    Does anyone have a better solution?

Please Sign in or register to post replies

Write your reply to:

Draft