Copied to clipboard

Flag this post as spam?

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


  • Mark 122 posts 255 karma points
    Jul 23, 2014 @ 10:54
    Mark
    0

    setting Field value from razor form page

    Hi Guys,

    I have a form with a few hidden fields in it. I want to populate the values from the form.cshtml page when it is loaded. What is the best way of doing this?

    I see that I can't set the FieldViewModel.Value as it is read only, so is there another way of doing this?

    I think I can do it by finding the values in the FieldType.HiddenField.cshtml files, but that means having to retrieve my values multiple times as I am using them on my parent page as well and it seems a bit wasteful. Is there an easy way of just passing the values in?

    Hopefully a simple one :-)

    Thanks,

    Mark

  • Dan 1288 posts 3942 karma points c-trib
    Jul 23, 2014 @ 11:51
    Dan
    0

    Hi Mark,

    So you want to get a value from a property on your page into Contour as a hidden field?  If that's right, you can use this syntax as the field default value:

    [#propertyAlias]

    You can do other thing like use cookies or querystring values in your form fields too - see page 21 of Contour Docs.

    Hope this helps...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies