Hi,
I've created a form with a selector. if no choice is made in the list, something like "--- not defined ---" is displaying.
How can I change it with "Please select" or something else ?
Thanks for your help.
Hi Fabrice,
Thank you for getting in touch.
You should be able to do it by using this Javascript below to replace the text in the field.
jQuery(document).ready(function(){
jQuery('.wpt-form-option:nth-child(1)').text('please select');
});
Add it to the JS editor section of your Form.
Please let me know if this helps.
Hi Shane,
Thanks a lot ! It helps. But...😂
Is there a possibility to apply it to some fields and not to some others ?
I explain... I have a list of places, of investment types where the code you gave me is just fine ! But I also have a field with a list of numbers starting from 1 to 5 where the default value should be "1". Here with this code, it's replacing the "1" line by "please select"
unfortunately, this doesn't work.
Is there a way to keep the 1 script you gave me but having 1 script per field with a "field selector" in order to choose which field is under the control of this script and another not ?
Hi Fabrice,
This is what i'm working on.
Would you mind providing me with a link to the page where the field is on?
The problem is that all the select fields share the same class so we need to scope it correctly.
Thanks,
Shane
Hi Shane,
I f you go to the envelope displayed on the left tab on the main page of the site (hidden link), a popup form is displaying.
This is where it is displayed.
Hi Fabrice,
Can you try this below.
jQuery(document).ready(function(){
jQuery('#cred_form_12963_1_1_ir-country').text('please select');
});
This should only target the country dropdown.
You should be able to see the select ID for the other items by inspecting the page element.
Please let me know if this helps.
Thanks,
Shane