From d8ca95415e296bef63ecdbfa7939beaf5c701d61 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 11 May 2017 19:17:11 +0000 Subject: [PATCH] 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 --- src/wp-admin/js/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/common.js b/src/wp-admin/js/common.js index 010a613f11..59fd1b68c3 100644 --- a/src/wp-admin/js/common.js +++ b/src/wp-admin/js/common.js @@ -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; };