Update The Label and Input Width for All Fields

In this guide, we will explain how to update the label and input width for all fields using JavaScript.

Drag and drop some Fields with a JavaScript field as shown below.

image
image

Click the pencil icon of the JavaScript field and paste the code.

image

Please use this code:

// Define field types to update
var formyoula_field_types = '.formyoula-Text, .formyoula-TextArea, .formyoula-Date, .formyoula-Number, .formyoula-Select, .formyoula-MultiSelect';
// Update labels
$( formyoula_field_types )
    .find( 'label' ).removeClass( 'col-sm-2' ).addClass( 'col-sm-6' );
// Update inputs
$( formyoula_field_types )
    .find( 'div' ).removeClass( 'col-sm-10' ).addClass( 'col-sm-6' );

Click the Advanced option in the JavaScript field, and set “0” for “JavaScript Load Delay”. Then save the changes.

image

Try the form.

image

For any questions, please contact us - [email protected] or the Formyoula in-app chat 🙂