CalcBuilder Forum

How to set a placeholder text for an Option list form field.

User Irwandy 2026-04-06 06:24:10

I’m trying to set placeholder text for an option list, but it doesn’t appear as the default option in the dropdown.

You can refer to the calculator in the link I provided.

Moonsoft support 2026-04-07 09:16:31

Hi,
an html select list element doesn't have a placeholder, this setting can only be applied to text inputs. If you try to set a default preselected value, you need to set it at the configuration field "Preferences->default'' instead.

And if you want something like 'select here your value' as the first option to be shown, then you have to include it together with the rest of the valid options. The first option value introduced will always be the value preselected at the field, so you can set it before 'January' option to see it at the top..

Hope this helps, regards

Silvia Martín
Moonsoft Team

User Irwandy 2026-04-07 09:37:57

If I added the 'select here' as the first valid option, how to prevent the form from submitting it as a value? For example, if the button calculate is pressed while the first option (select here) is selected - the calculator give error message like "Please select correct value".

Moonsoft support 2026-04-08 09:37:37

Hi,
the select input fields have always a value selected, so if you want to create a validation of 'field required' that won't allow the first option, you can configure the field like this:
- Check the field as 'required' at form fields configuration
- Set a specific value for the option with the caption (for example: novalid). So your options configuration will be something like

--Select value-- novalid
Januari(31 Hari) 31
Februari(28 Hari) 28
....etc


- At the js tab 'executed on loaded page', place this line:

CB("option").attr("value","");

This will give the options 'novalid' an empty value, so the validation 'required' will fail for them.

Hope this helps, kind regards
Silvia Martín
Moonsoft Team

...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!
...
List Manager

Build different lists for your site

Buy now!