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
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.
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.
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.
3. Insert the script
Scroll down to the section Customise styling, HTML in head, and JavaScript, and click to expand the menu.
In the text field titled Apply JavaScript with jQuery support to this particular form, insert your script.
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.
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.