-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use the warning class for form submissions messages
- Loading branch information
1 parent
143d2eb
commit 0048f43
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,21 +19,21 @@ function onSubmit(token) { | |
data: f.serialize(), | ||
beforeSend: function() { | ||
$( "#sfmc-form" ).toggle(); | ||
$( "#message" ).html( "Thank you for your submission. Your request is being processed..." ).addClass( "callout primary" ); | ||
$( "#message" ).html( "Thank you for your submission. Your request is being processed..." ).addClass( "callout warning" ); | ||
message.scrollIntoView( { behavior: "smooth", block: 'center' } ); | ||
}, | ||
success: function(data) { | ||
var msg = $( data ).find( "p" ).text(); | ||
if ( msg.includes( "Error" ) ) { | ||
$( "#message" ).html( msg ).removeClass( "primary" ).addClass( "alert" ); | ||
$( "#message" ).html( msg ).removeClass( "warning" ).addClass( "alert" ); | ||
} else { | ||
$( "#message" ).html( msg ).removeClass( "primary" ).addClass( "success" ); | ||
$( "#message" ).html( msg ).removeClass( "warning" ).addClass( "success" ); | ||
} | ||
message.scrollIntoView( { behavior: "smooth", block: 'center' } ); | ||
}, | ||
error: function(xhr, status, error) { | ||
var errorMessage = xhr.status + ': ' + xhr.statusText; | ||
$( "#message" ).html( "There was an error processing your submission. Please try again or contact us directly at [email protected].<br>(" + errorMessage + ")" ).removeClass( "primary" ).addClass( "alert" ); | ||
$( "#message" ).html( "There was an error processing your submission. Please try again or contact us directly at [email protected].<br>(" + errorMessage + ")" ).removeClass( "warning" ).addClass( "alert" ); | ||
message.scrollIntoView( { behavior: "smooth", block: 'center' } ); | ||
} | ||
} | ||
|