Copied to clipboard

Flag this post as spam?

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


  • Owain Williams 482 posts 1414 karma points MVP 7x c-trib
    Mar 01, 2022 @ 08:18
    Owain Williams
    0

    How to disable the green notification bar

    Hi, is there a way to disable the default green notification bar.

    Just now in my content app, when I click a button I get a content saved notification when my button doesn't actually do a save at all. I'm guessing I've done something wrong but not sure what.

    As you can see from the image below - I've successful created my own notification for when something goes wrong and I'd prefer that to show rather than the green default one.

    enter image description here

  • Anders Bjerner 487 posts 2995 karma points MVP 8x admin c-trib
    Mar 01, 2022 @ 08:23
    Anders Bjerner
    101

    Hi Owain

    HTML buttons are submit buttons by default, which is what then triggers a form submit, which then saves the page.

    So without having seen your code, I think your buttons should look something like:

    <button type="button">Yay</button>
    
  • Owain Williams 482 posts 1414 karma points MVP 7x c-trib
    Mar 01, 2022 @ 08:32
    Owain Williams
    0

    Thanks Anders! Didn't realise that and that indeed has fixed the problem. I had

     <input type="submit" id="tweet_button" ng-click="submit(vm)" class="btn btn-primary" value="Tweet">
    

    but changing it to:

     <button type="button" id="tweet_button" ng-click="submit(vm)" class="btn btn-primary">Tweet</button>
    

    Fixed it 😁#h5yr

  • Anders Bjerner 487 posts 2995 karma points MVP 8x admin c-trib
    Mar 01, 2022 @ 08:38
    Anders Bjerner
    1

    Great to see that helped. <input type="button" /> could also work, but IMO <button> elements are more flexible.

    Umbraco also has an umbButton directive that can help going beyond a standard button:

    https://apidocs.umbraco.com/v9/ui/#/api/umbraco.directives.directive:umbButton

    For instance, you can set a button state for when the button is clicked, so the user sees a small loader instead of the button text. Eg. similar to when clicking the save button.

Please Sign in or register to post replies

Write your reply to:

Draft