Copied to clipboard

Flag this post as spam?

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


  • Darren Eccles 59 posts 298 karma points
    Apr 06, 2018 @ 10:52
    Darren Eccles
    0

    Custom Property Editor - required field always showing

    Hi Guys,

    I have a property editor with a dynamic input. I have set the input to be required and works has it should when you click save in the back office.

    However, the required text is always showing, before I click save.

    I use the built-in help tags:

    <input class="umb-editor umb-textstring" type="{{field.templateOptions.type}}" ng-attr-name="{{field.key}}" ng-model="model.value[field.key]" placeholder="{{field.templateOptions.placeholder}}" ng-required="{{field.templateOptions.required}}">
                                            <span class="help-inline" val-msg-for="{{field.key}}" val-toggle-msg="required">Required</span>
    

    How do I hide the 'required' text initial?

    Thanks

    Darren

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 09, 2018 @ 07:05
    Michaël Vanbrabandt
    0

    Hi Darren,

    I was comparing your code with mine and the only thing that is different is the ng-attr-name="{{field.key}}" which is at my side name="{{field.key}}".

    Not sure if that could be the reason but its worth a shot!

    Hope this helps.

    /Michaël

  • Darren Eccles 59 posts 298 karma points
    Apr 09, 2018 @ 07:39
    Darren Eccles
    0

    Hi Michaël,

    Thanks for your reply, however it didn't work. The problem seems to be using dynamic field names.

    If I set the name to:

    name="name"
    

    This works, however every form field is named 'name'.

    I may have to look for alternative work around, thanks again.

    Darren

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 09, 2018 @ 07:41
    Michaël Vanbrabandt
    0

    Hi Darren,

    could you have a look at this thread on stackoverflow:

    https://stackoverflow.com/questions/27071413/dynamic-form-name-attribute-input-type-text-name-variable-name-in

    Maybe this can help you.

    /Michaël

  • Darren Eccles 59 posts 298 karma points
    Apr 09, 2018 @ 07:49
    Darren Eccles
    0

    Hi Michaël,

    Thanks for the link, I've taken at look at this and I think the underlying problem is the version of angularjs in umbraco (currently using 1.1.5).

    Someone mentions this was fixed in version 1.3.0, so I don't know if its possible to upgrade the version of angularjs in umbraco?

    Darren

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Apr 09, 2018 @ 07:51
    Michaël Vanbrabandt
    0

    Hi Darren,

    you are correct about the Angular version part, but it won't be possible to upgrade the version of Angular inside Umbraco.

    The part of creating a new custom directive could that be a solution?

    Hope this helps.

    /Michaël

  • Darren Eccles 59 posts 298 karma points
    Apr 09, 2018 @ 07:54
    Darren Eccles
    1

    Hi Michaël,

    Thanks again, I'm going to implement a new directive :)

    I'll come back to you and let you know how I get on

    Darren

Please Sign in or register to post replies

Write your reply to:

Draft