Jquery validation plugin for radio button [closed]

Tom

New Member
How to validate a radio button using jquery validation plugin?. In the below code iam using jquery validation plugin to validate radio button. Please advise me whether it is the right way to handle it.Thanks in Advance.\[code\]<script type="text/javascript"> $(document).ready(function () { $('#storeAppCreation').validate( { rules: { txtAppID: { required: true }, txtAppName: { required: true, minlength: 4 }, ddlSelectAuthProcess: { required: true }, txtAppUrl: { required: true }, rdodeliverychnl: { required: true } }, messages: { txtAppID: { required: 'Please generate App ID' }, txtAppName: { required: 'Please enter the Application Name', minlength: 'Please enter a app name more than 4 characters' }, ddlSelectAuthProcess: { required: 'Please select the Auth Process' }, txtAppUrl: { required: 'Please enter the Application URL' }, rdodeliverychnl: { required: 'Please choose the delivery channel' } } }); }); </script>\[/code\]HTML CODE :\[code\]<div id='CreateNewApp' style='display:block'> <form id='storeAppCreation' method='post' action='CreateAppController'> <table class="form"> <tr> <td style="padding-right: 35px;text-align: right;width: 50%;"> <label> Application ID : </label> </td> <td style="text-align: left;"> <input type='text' id='txtAppID' name='txtAppID' style='margin-top:12px' disabled='disabled' /> </td> </tr> <tr> <td style="padding-right: 35px;text-align: right;width: 50%;vertical-align:middle"> <label> Application Details:</label> </td> <td> <input type='text' id='txtAppName' name='txtAppName' style='margin-top: 15px; width: 250px;' /> </td> </tr> <tr> <td style="padding-right: 35px;text-align: right;width: 50%;"> <label> Authentication Process : </label> </td> <td style="text-align: left;"> <select id="ddlSelectAuthProcess" name="ddlSelectAuthProcess" style="margin-top: 15px; height: 30px; width: 259px;"> <option value="">Select Authentication Process</option> <option value="http://stackoverflow.com/questions/15698365/Single Factor">Single Factor</option> <option value="http://stackoverflow.com/questions/15698365/Multiple Factor">Multiple Factor</option> </select> </td> </tr> <tr> <td style="padding-right: 35px;text-align: right;width: 50%;"> <label> App URL : </label> </td> <td style="text-align: left;"> <input type='text' id='txtAppUrl' name='txtAppUrl' style='margin-top:15px;width:250px' /> </td> </tr> <tr> <td style="padding-right: 35px;text-align: right;width: 50%;"> <label> Delivery Channel : </label> </td> <td style="text-align: left;"> <input type='radio' value='http://stackoverflow.com/questions/15698365/1' name='rdodeliverychnl' style='margin-top:15px' g />E-Mail <input type='radio' value='http://stackoverflow.com/questions/15698365/2' name='rdodeliverychnl' style='margin-left:16px' />Sms <input type='radio' value='http://stackoverflow.com/questions/15698365/3' name='rdodeliverychnl' style='margin-left:16px' />IVR Re-Prompt </td> </tr> <tr> <td> <input type ='submit' value='http://stackoverflow.com/questions/15698365/Next >' id='btnCreateAppSave' class="btn btn-large" style='margin-left: 540px; width: 109px; margin-top: 50px;' /> </td> <td> <input type='reset' id='btnReset' value='http://stackoverflow.com/questions/15698365/Reset' class="btn btn-large" style='margin-left: 25px; width: 100px;' /> </td> </tr> </table> </form> </div>\[/code\]
 
Back
Top