Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery select input value empty and hasclass

$('.check-fields').on('click', function () {

    var reqlength = $('.required-entry').length;
    console.log(reqlength);
    var value = $('.required-entry').filter(function () {
        return this.value != '';
    });

    if (value.length>=0 && (value.length !== reqlength)) {
        alert('Please fill out all required fields.');
    } else {
        alert('Everything has a value.');
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: js lambda 
::  
::  
Javascript ::  
Javascript :: convert int to string javascript 
:: google scripts urlfetchapp hearders and body 
Javascript :: dropdowndirection 
Javascript :: datatable on error.dt 
:: auto increase hight of textarea with alpine js 
::  
Javascript ::  
Javascript :: JQuery Autocomplete no result found 
Javascript ::  
Javascript :: disable textbox on plumsail 
::  
::  
:: setTilme out js 
:: attr jquery 
Javascript :: install ejs 
:: how to check if expo app is running on the web 
Javascript ::  
Javascript ::  
:: Recorrer Array con forEach 
Javascript ::  
Javascript ::  
:: Firebase: Error (auth/invalid-api-key). 
Javascript :: map array with only lenghth given 
Javascript ::  
Javascript :: array prototype find javascript 
::  
ADD CONTENT
Topic
Content
Source link
Name
5+5 =