Copied to clipboard

Flag this post as spam?

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


  • J 447 posts 864 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?

     

  • Comment author was deleted

    Aug 01, 2013 @ 10:30

    Hey,

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

  • J 447 posts 864 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 447 posts 864 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?

  • Comment author was deleted

    Aug 01, 2013 @ 10:44

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

  • J 447 posts 864 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?

  • Comment author was deleted

    Aug 01, 2013 @ 10:55

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

  • J 447 posts 864 karma points
    Aug 01, 2013 @ 11:04
    J
    0

    Where would i do that? As its an Enum?

  • Comment author was deleted

    Aug 01, 2013 @ 11:12

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

  • J 447 posts 864 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?

  • Comment author was deleted

    Aug 01, 2013 @ 11:22

    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("", "",

Please Sign in or register to post replies

Write your reply to:

Draft