Last active
October 9, 2017 03:07
-
-
Save carlosonweb/dd9cf680e4628eb62b6af9174a8b3bc5 to your computer and use it in GitHub Desktop.
Modify the Labels, Placeholders and Error Messages on the BB Contact Form
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
// In BB, you can embed this to the page by going to Tools > Layout CSS/JavaScript > JavaScript | |
jQuery(document).ready(function($){ | |
// Change the Labels | |
$('#mybb-contact-form label[for="fl-name"]').text('NAME Label here...'); | |
$('#mybb-contact-form label[for="fl-email"]').text('EMAIL Label here...'); | |
$('#mybb-contact-form label[for="fl-phone"]').text('PHONE Label here...'); | |
$('#mybb-contact-form label[for="fl-message"]').text('MESSAGE Label here...'); | |
// Change the placeholders | |
$('#mybb-contact-form input[name="fl-name"]').attr('placeholder', 'NAME Placeholder here...'); | |
$('#mybb-contact-form input[name="fl-email"]').attr('placeholder', 'EMAIL Placeholder here...'); | |
$('#mybb-contact-form input[name="fl-phone"]').attr('placeholder', 'PHONE Placeholder here...'); | |
$('#mybb-contact-form textarea[name="fl-message"]').attr('placeholder', 'MESSAGE Placeholder here...'); | |
// Even better if you can reference the BB Contact Form ID | |
$('#mybb-contact-form .fl-name .fl-contact-error').text('NAME Error Message'); | |
$('#mybb-contact-form .fl-email .fl-contact-error').text('EMAIL Error Message'); | |
$('#mybb-contact-form .fl-phone .fl-contact-error').text('PHONE Error Message'); | |
$('#mybb-contact-form .fl-message .fl-contact-error').text('MESSAGE Error Message'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment