Public Ticket #3358024

Customer Registration fields

Closed
Comments
5 Tickets 1
Nick Monroe started the conversation 3 years ago on April 27, 2023 at 1:25pm

Hello

I was trying to implement forcing all capital letters at customer registration with the registration fields by css, but that failed.   Is there a way to force all customer registrations with the B2bking registration fields to be all capital letters when entered?   This will help my system greatly.


Thank you 


Nick Monroe

2,762
KingsPlugins replied 3 years ago on April 28, 2023 at 12:45am

Hi Nick,

I worked on a code snippet that I believe can solve this.

Please try to add this PHP code snippet to your site:

add_action('wp_head', function(){
    ?>
    <script>
      // Define a named function to handle the form submission
      function handleFormSubmission(event) {
        // Loop through all input fields and update their values to uppercase
        jQuery(this).find('input[type="text"], input[type="email"], input[type="tel"]').each(function() {
          jQuery(this).val(jQuery(this).val().toUpperCase());
        });
      }
      // Wait for the document to be ready
      jQuery(document).ready(function() {
        // Attach a submit event listener to all forms with the class "register"
        jQuery('.register').on('submit', handleFormSubmission);
      });
    </script>
    <?php
});

A PHP snippet can be added to functions.php, or by following our guide here: https://b2bkingplugin.com/docs/how-to-add-a-snippet-php-or-js/

Kind regards,

Stefan

1

Sign In