jQuery Validator

Set the position property of the jqxValidator. Author: http://jqwidgets.com

by jqwidgets

HTML

<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<form style="float: right;" id="testForm" action="./">
    <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>
</form>
<input type="button" style="margin: 10px;" id="jqxbutton" value="Submit" />

JavaScript

$('#testForm').jqxValidator({
     position: 'left',
     rules: [{
         input: '#userInput',
         message: 'Username is required!',
         action: 'blur',
         rule: 'required'

     }, {
         input: '#emailInput',
         message: 'Invalid e-mail!',
         action: 'blur',
         rule: 'email'

     }, {
         input: '#emailInput',
         message: 'Invalid e-mail!',
         action: 'blur',
         rule: 'required'

     }]
 });
$("#jqxbutton").jqxButton({
       theme: 'energyblue',
       width: 100,
       height: 30
   });
 $("#jqxbutton").click(function () {
     $('#testForm').jqxValidator('validate');
 });