Form Builder

How to change the drop-down menu’s default text

Senest redigeret:

When creating your forms, it can be a good idea for the text in drop-down menus to give your donors or members extra guidance when filling in the form. If the default text does not suit your needs, it is easy to change – read on to find out how.

Example

Sk_rmbillede_2021-08-16_kl._13.47.05.png
In this example, we want to change the text “Select project from the list” to “Select from our projects”. This text is also called placeholder text.
Sk_rmbillede_2021-08-16_kl._13.58.02.png

 

1. Locate your form

  • Go to Form Builder in the main OnlineFundraising menu.

  • Find the form in the list that you want to edit, then click its title.

formbuilder.png

 

2. Locate the drop-down field

  • Scroll down to the specific field for which you want to edit the default text.

  • Note the field’s Reference, which is displayed under Reference. You will need this text in your script.

Sk_rmbillede_2021-08-16_kl._14.12.30.png

 

3. Insert the script

  • Scroll down to the section Customise styling, HTML in head, and JavaScript, and click to expand the menu.
    Sk_rmbillede_2021-08-16_kl._14.15.56.png

  • In the text field titled Apply JavaScript with jQuery support to this particular form, insert your script.
    Sk_rmbillede_2021-08-16_kl._14.17.34.png

 

How to write the script

When writing your script, use the reference for the field you want to change, and the text you want to replace the default text with. The rest of the script can be copied from the text below:

$('#field_reference option[data-index="0"]').text('Write your new default text here');

In the example above, the script would be as follows:

$('#field_projekt option[data-index="0"]').text('Select from our projects');

4. Save your changes

  • Remember to click the Update button to save your changes.

update.png

  • You can now click View form to see your changes.

 

For “purpose” selection

If you want to change the text for the purpose field, you can follow the same steps. The code would look like this:

$('#field_purpose option[data-index="0"]').text('Select from our projects');

If you have any questions, feel free to write to us at support@onlinefundraising.dk.

Was this article helpful?

0 out of 0 found this helpful