Copied to clipboard

Flag this post as spam?

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


  • jivan thapa 194 posts 681 karma points
    Jan 15, 2014 @ 02:56
    jivan thapa
    0

    Get all values from the DropDownList: contour

    How to get all values from a dropdownlist on contour, Is there any contour API?

    For example. I need to get values  "a,b,c & d" from the dropdownlist type. 

    Using record.GetRecordField("dropdownlist").ValuesAsString() contains only the value that is selected by the user when they submit the data.

    Thank you

    Jeevan

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 15, 2014 @ 05:25
    Fuji Kusaka
    0

    What do you mean by you are not getting the values from the dropDown List ? Are the values being saved in te Entries ?

     

  • jivan thapa 194 posts 681 karma points
    Jan 15, 2014 @ 08:51
    jivan thapa
    0

    Fuji, I mean. I need to read the all items from dropdownlist, not just a user's selected item.

    For example. In figure: dropdownlist has items a, b, c, & d. If user selects "c" and submits the form, record.GetRecordField("dropdownlist").ValuesAsString() contains "c". However if you want to put some logic on it, you need all items. For example, let say you want to know the index of the selected item.

    Does it make sense?

  • Comment author was deleted

    Jan 15, 2014 @ 11:02

    Yeah record only contains submission, for the form design you'll need the form object :) that will contain all form details including the prevalues for the fields

  • jivan thapa 194 posts 681 karma points
    Jan 15, 2014 @ 14:16
    jivan thapa
    0

    Thanks Tim.

    How to get the Form object by Guid?

    E.g. Guid gId = record.Form; //get the form guid

    // I would like to get Form object "Form gForm = Form get by gId"

  • Comment author was deleted

    Jan 15, 2014 @ 14:36

    Check FormStorage in Umbraco.Forms.Core.Data

Please Sign in or register to post replies

Write your reply to:

Draft