Skip to content

Instantly share code, notes, and snippets.

@carlosonweb
Last active October 9, 2017 03:07
Show Gist options
  • Save carlosonweb/dd9cf680e4628eb62b6af9174a8b3bc5 to your computer and use it in GitHub Desktop.
Save carlosonweb/dd9cf680e4628eb62b6af9174a8b3bc5 to your computer and use it in GitHub Desktop.
Modify the Labels, Placeholders and Error Messages on the BB Contact Form
// 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