jQuery UI Widgets Forums Plugins Validator, Drag & Drop, Sortable Can I use jqxValidator WITHOUT form

This topic contains 2 replies, has 2 voices, and was last updated by  kjm 9 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Can I use jqxValidator WITHOUT form #75129

    kjm
    Participant

    I am developing in ASP.NET, the aspx page already has a form so an additional form within that form is an error.
    Can I use the jqxValidator without using a form?
    I didn’t see any examples, any assistance would be greatly appreciated.

    Can I use jqxValidator WITHOUT form #75133

    Dimitar
    Participant

    Hello kjm,

    jqxValidator can also be initialized from a div element. Here is an example:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
        <link rel="stylesheet" href="../../jqwidgets/styles/jqx.summer.css" type="text/css" />
        <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqxvalidator.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $('#testForm').jqxValidator({ rules: [
                    { input: '#userInput', message: 'The username should be more than 3 characters!', action: 'keyup', rule: 'minLength=3' },
                    { input: '#emailInput', message: 'Invalid e-mail!', action: 'keyup', rule: 'email'}], theme: 'summer'
                });
            });
        </script>
    </head>
    <body>
        <div id="testForm">
            <table class="register-table">
                <tr>
                    <td>
                        Username:
                    </td>
                    <td>
                        <input type="text" id="userInput" class="text-input" />
                    </td>
                </tr>
                <tr>
                    <td>
                        E-mail:
                    </td>
                    <td>
                        <input type="text" id="emailInput" class="text-input" />
                    </td>
                </tr>
            </table>
        </div>
    </body>
    </html>

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Can I use jqxValidator WITHOUT form #75153

    kjm
    Participant

    My bad, I actually placed the validation for inside the main aspx form. once i moved it outside the main form it worked fine.
    That’s what you get when you don’t read the entire error message.
    sorry for the inconvenience, love the tools !!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.