Disable spaces input field in Custom Field ?

Dear All,

I have issue with Text Field of Custom Field. I want disable Users input spaces in text field.

I'm using wpcode snippets with Code Type is JavaScripts:

 jQuery(document).ready(function ($) {
        jQuery( '.bookly-form' ).keydown(function(e) {     
            if (event.key === ' ') {
                return false;
            }       
        });
 });

it's working but apply to all fields :).

I want to disable 1 Custom Field is: custom_field#59929

anyone have same idea or issue like that.

Thank you.

 

0

Comments

2 comments
Date Votes
  • Hello Dave,

    Please ensure the code is executed after the 'Details' step of the booking form has been rendered. Replace the selector jQuery( '.bookly-form' ) with jQuery( '.bookly-form .bookly-custom-field-row[data-id="59929"] input' ). You can insert this code directly into the text field under Bookly > Appearance > Step by Step Form > Details section:

    <script>jQuery(document).ready(function(o){jQuery('.bookly-form .bookly-custom-field-row[data-id="59929"] input').keydown(function(o){if(" "===event.key)return!1})});</script>

    0
  • The emergence of AI phones https://vertu.com/products/metavertu-2-calfskin-web3-ai-phone-black/ has transformed the way we communicate. They not only enhance the functions of smart assistants but also better understand user needs through deep learning. For those wanting to experience the perfect blend of luxury and technology, Vertu is undoubtedly an excellent choice.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post