We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





127169 Oct 31,2016 12:12 PM UTC Nov 1,2016 09:53 AM UTC JavaScript 1
Tags: ejDropDownList
Asked On October 31, 2016 12:12 PM UTC

Hi Team .
                                 How to validate drop down and textbox  in page load and  button click event

Prince Oliver [Syncfusion]
Replied On November 1, 2016 09:53 AM UTC

Hi Rajivgandhi,   
Thanks for contacting Syncfusion Support.   
In order to validate dropdownlist using jQuery validation plugin, you need to set defaults for the validator. Refer to the following code snippet.   
            ignore: [], // To include hidden input in validation   
            errorClass: 'e-validation-error'// To get the error message on jquery validation   
            errorPlacement: function (error, element) {    
                             $( element ).closest( "form" )   
                .find( "label[for='" + element.attr( "id" ) + "']" ).append( error );   
            } // To place the error message on required element   
Note: To include dropdownlist in validation, you have to clear the ignore in setDefaults because by default in jQuery validation the hidden inputs are ignored from validation and our dropdownlist has the input element hidden.   
Set the rules for validation.    
       rules: {   
              field: {   
                     required: true  // Rules for textbox   
              drpdwn: {   
                     required: true  // Rules for Dropdownlist   
The Textbox and Dropdownlist will be validated on form submit. To validate on button click use form valid method.   
function onClick(){   

We have attached a Playground Sample for your reference.   


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon