summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy/sharing.js')
-rw-r--r--plugins/jetpack/modules/sharedaddy/sharing.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/sharing.js b/plugins/jetpack/modules/sharedaddy/sharing.js
index 9f5f7f9f..6c31c6c7 100644
--- a/plugins/jetpack/modules/sharedaddy/sharing.js
+++ b/plugins/jetpack/modules/sharedaddy/sharing.js
@@ -380,6 +380,8 @@ var updateLinkedInCount = function( data ) {
// Submit validation
$( '#sharing_email input[type=submit]' ).unbind( 'click' ).click( function() {
var form = $( this ).parents( 'form' );
+ var source_email_input = form.find( 'input[name=source_email]' );
+ var target_email_input = form.find( 'input[name=target_email]' );
// Disable buttons + enable loading icon
$( this ).prop( 'disabled', true );
@@ -389,12 +391,12 @@ var updateLinkedInCount = function( data ) {
$( '#sharing_email .errors' ).hide();
$( '#sharing_email .error' ).removeClass( 'error' );
- if ( ! $( '#sharing_email input[name=source_email]' ).share_is_email() ) {
- $( '#sharing_email input[name=source_email]' ).addClass( 'error' );
+ if ( ! source_email_input.share_is_email() ) {
+ source_email_input.addClass( 'error' );
}
- if ( ! $( '#sharing_email input[name=target_email]' ).share_is_email() ) {
- $( '#sharing_email input[name=target_email]' ).addClass( 'error' );
+ if ( ! target_email_input.share_is_email() ) {
+ target_email_input.addClass( 'error' );
}
if ( $( '#sharing_email .error' ).length === 0 ) {