locked
Enable a button in jquery once a certain string has been entered RRS feed

  • Question

  • User-1188570427 posted

    I am entering in XML into a text area for some manipulation etc.

    I do not want to enable the "next" button until I can validate that XML has been entered.

    1. What is the best event to hit to change the button from disabled to enabled when text is entered?
    2. What is the best way to check that it is true XML that is entered?

    Thanks. 

    Wednesday, May 22, 2019 9:46 PM

Answers

  • User-2054057000 posted

    You will have to work in the jQuery .change() event of your text box:

    $("#yourTextBox").change(function () {
        ....
    });

    For validation XML with XSD you will have to create your own logic, which I think is not difficult at all. Check this tutorial for it:

    JavaScript XSD Validation

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 23, 2019 3:32 AM