Code Monkey home page Code Monkey logo

Comments (3)

PaulNieuwelaar avatar PaulNieuwelaar commented on June 5, 2024

Hi Sven,

Unfortunately we currently don't support disabling the alert buttons. As you mentioned it's technically possible with something like this: Alert.$("button:contains('OK')").prop("disabled", true) but there's no guarantee that the buttons will still be buttons in the future etc, so do this at your own risk.

The way we usually recommend adding validation is to keep the buttons clickable, but add the validation on click. If some input on the popup is invalid then you can display the error message to the user and prevent the button action. Note that you can use the preventClose property on the button object to keep the alert open so you can run validation, then manually close it with Alert.hide(); when the validation is successful.

You may also want to consider upgrading to v3.0 as the support for Alert.$ and nested alerts are only in 3.0.

Cheers,
Paul

from alertjs.

Sven-Q avatar Sven-Q commented on June 5, 2024

Hi Paul,

Thanks for the quick Response.

At the Moment we have fixed it by keeping the custom Buttons (with Code) in the HTML itself and not defining them in the constructor. Afterwards we then close the Dialog ourselves.

I only made this Issue, due to that it actually feels like this is a missing feature in the great product you provide and which could Maybe eaily be implemented in the button constructor?

Anyway, I thank you once more for the quick Response and the great product you provide.

Regards,
Sven

from alertjs.

PaulNieuwelaar avatar PaulNieuwelaar commented on June 5, 2024

Hi Sven,

Appreciate the feedback, we'll definitely consider d this as a feature in the future, as I agree that it could be useful in certain scenarios such as yours.

Thanks again,
Paul Nieuwelaar

from alertjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.