Copied to clipboard

Flag this post as spam?

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


  • J 351 posts 606 karma points
    Aug 01, 2013 @ 10:25
    J
    0

    FormPage and ForFieldsets

    I have a weird issue occuring. I create a form in code. I upload it and notice in the designer that i have Registration and Details (i think within the Fieldsets). I delete the text and for some reason which im not sure it reappears again.

    The initialisation of Registration and Details that i can find are 

    public class Forms
    {
        public Forms()
        {
        }
    
        public enum FormPages
        {
            Registration
        }
    
        public enum FormFieldsets
        {
            Details
        }

    but a little unsure how to hide the text from appearing?

     

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 01, 2013 @ 10:30
    Tim Geyssens
    0

    Hey,

    A code first form will always override the manual changes made to the form...

  • J 351 posts 606 karma points
    Aug 01, 2013 @ 10:42
    J
    0

    So how could i stop this from happening as the user makes a change and then the two text fields reappear?

  • J 351 posts 606 karma points
    Aug 01, 2013 @ 10:44
    J
    0

    Better question is once the form is showing up in Contour with the text Reg and Details, how could i blank this text in code or ensure if the user changes the form it remains blank?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 01, 2013 @ 10:44
    Tim Geyssens
    0

    You can't at this point, but can make it a config option in the next maintenance release

  • J 351 posts 606 karma points
    Aug 01, 2013 @ 10:51
    J
    0

    Sorry but just to double check - I cant remove those text fields. Whatever i declare in code is what will appear on the form?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 01, 2013 @ 10:55
    Tim Geyssens
    0

    Yup but you can just use an empty string as the page/fieldset caption then they will be empty

  • J 351 posts 606 karma points
    Aug 01, 2013 @ 11:04
    J
    0

    Where would i do that? As its an Enum?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 01, 2013 @ 11:12
    Tim Geyssens
    0

    Nope not as an enum, just on the form and fieldset attribute

  • J 351 posts 606 karma points
    Aug 01, 2013 @ 11:17
    J
    0

    Sorry a little lost now..... If i go into Umbraco > Contour > Form and make the changes to the fieldset and form properties they revert back at a later stage - unsure why though?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Aug 01, 2013 @ 11:22
    Tim Geyssens
    100

    A code first form will always override the manual changes made to the form..., so you need to make the changes to your code... or remove the code first code...

    to have an empty one in code, use empty strings as the page and fieldset caption

    [Form("my form", ShowValidationSummary = true, MessageOnSubmit = "Profile updated!")] public class Profile: FormBase { [Field("", "", Mandatory = true, DefaultValue = "{member.name}")] public string Name { get; set; }

    so this line [Field("", "",

  • 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