Administration: Ensure validateForm also validates other input fields.

With this change, textareas and select inputs will be checked as well.

Props shadyvb.
Fixes #37540.


git-svn-id: https://develop.svn.wordpress.org/trunk@40634 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2017-05-11 19:17:11 +00:00
parent 2dbc6ea67b
commit d8ca95415e

View File

@ -79,9 +79,9 @@ $document.ready(function(){columns.init();});
validateForm = function( form ) {
return !$( form )
.find( '.form-required' )
.filter( function() { return $( 'input:visible', this ).val() === ''; } )
.filter( function() { return $( ':input:visible', this ).val() === ''; } )
.addClass( 'form-invalid' )
.find( 'input:visible' )
.find( ':input:visible' )
.change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )
.length;
};