Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 12, 2013 @ 14:00
    Fuji Kusaka
    0

    Custom TextField

    Hi,

    I have a website where the client wants to have contour so as to be able to add new forms on certain pages and each of those forms will have some 3 common textField when combined must have a total value of 100 %.

    So i was thinking of creating a custom TextField where the admin will be able to add 3 of them in any form on creation but how do i get to display the total % which needs to be 100 % at all time. No decimal will be allowed however.

    The form should be something like this,

    TextField1   TextField2   TextField3    Total %
        10                30                50               100

    My question is what is the best way of doing this ? How do i get to display the total % ?

    Any suggestion most welcome

    //Fuji

  • Comment author was deleted

    Oct 12, 2013 @ 14:58

    Probably with some client side js

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 14, 2013 @ 10:06
    Fuji Kusaka
    0

    HIi Tim,

    I have created the Custom TextField but somehow the textField is only visible in preview Mode. What am i missing here ?

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2013 @ 09:29
    Fuji Kusaka
    0

    Weird if i move the field to the first position of my form dont see any other the remaining fields. But again its only in the preview mode that the form is viewable.

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2013 @ 12:37
    Fuji Kusaka
    0

    My mistak...finally got it working. I miss

     System.Web.UI.WebControls.TextBoxMode.SingleLine;
  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2013 @ 17:00
    Fuji Kusaka
    0

    Hi Tim,

    I could also add a new Custom field to this GuidForm Where i can add a Label which will only show up using the conditional logic with the total % but on submit it does the validation for the 100 % right ?

    The only thing can you tell me what its tthe FieldSetting for labelling ? 

    [Umbraco.Forms.Core.Attributes.Setting("Total Allocation", description = "Total %", control = "Umbraco.Forms.Core.FieldSetting.Label")]
    public string ShowTotal { get; set; }
  • Comment author was deleted

    Oct 21, 2013 @ 10:13

    Don't think there is one

    Try checking Umbraco.forms.Core.FieldSettings for all the options you have

Please Sign in or register to post replies

Write your reply to:

Draft