diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js
index 2fc0c38828..d97b864e9f 100644
a
|
b
|
$document.ready(function(){columns.init();}); |
161 | 161 | window.validateForm = function( form ) { |
162 | 162 | return !$( form ) |
163 | 163 | .find( '.form-required' ) |
164 | | .filter( function() { return $( ':input:visible', this ).val() === ''; } ) |
| 164 | .filter( function() { return $( ':input:visible', this ).val().trim() === ''; } ) |
165 | 165 | .addClass( 'form-invalid' ) |
166 | 166 | .find( ':input:visible' ) |
167 | 167 | .change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } ) |
diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js
index 386f8ae593..a0e64098f7 100644
a
|
b
|
|
459 | 459 | } |
460 | 460 | } ); |
461 | 461 | |
| 462 | /* Ensure nickname and mail are not empty */ |
| 463 | $( document ).on( 'submit', 'form', function(){ |
| 464 | if ( ! validateForm( this ) ) |
| 465 | return false; |
| 466 | } ); |
462 | 467 | })(jQuery); |
diff --git a/src/wp-admin/user-edit.php b/src/wp-admin/user-edit.php
index f478c3be57..cc9f39c560 100644
a
|
b
|
switch ( $action ) { |
234 | 234 | |
235 | 235 | <hr class="wp-header-end"> |
236 | 236 | |
237 | | <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate" |
| 237 | <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate" class="validate" |
238 | 238 | <?php |
239 | 239 | /** |
240 | 240 | * Fires inside the your-profile form tag on the user editing screen. |
… |
… |
endif; //!IS_PROFILE_PAGE |
435 | 435 | <td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profileuser->last_name ); ?>" class="regular-text" /></td> |
436 | 436 | </tr> |
437 | 437 | |
438 | | <tr class="user-nickname-wrap"> |
| 438 | <tr class="user-nickname-wrap form-required"> |
439 | 439 | <th><label for="nickname"><?php _e( 'Nickname' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> |
440 | 440 | <td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profileuser->nickname ); ?>" class="regular-text" /></td> |
441 | 441 | </tr> |
… |
… |
endif; //!IS_PROFILE_PAGE |
483 | 483 | <h2><?php _e( 'Contact Info' ); ?></h2> |
484 | 484 | |
485 | 485 | <table class="form-table"> |
486 | | <tr class="user-email-wrap"> |
| 486 | <tr class="user-email-wrap form-required"> |
487 | 487 | <th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> |
488 | 488 | <td><input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profileuser->user_email ); ?>" class="regular-text ltr" /> |
489 | 489 | <?php |