kevinchappell / formBuilder

A jQuery plugin for drag and drop form creation
https://formbuilder.online
MIT License
2.61k stars 1.38k forks source link

First option selected in getData #621

Open rssluca opened 6 years ago

rssluca commented 6 years ago

Hello all,

The first option is selected in getData even when there is a placeholder (in select fields). Ideally, no options should be selected by default unless specified by the user.

kevinchappell commented 6 years ago

That is the default functionality of select control however you can configure it to work differently as demonstrated below or use a checkbox group. select-placeholder

Alternatively you could use the replaceFields option to change default functionality of the select field. https://codepen.io/kevinchappell/pen/GMMYWO

kevinchappell commented 6 years ago

Reopening because after thinking about it... this is a bug. Ideally setting a placeholder should de-select the default option.

rssluca commented 6 years ago

Thanks for looking at this Kevin, I ended up removing lines 397 to 399 in form-builder.js. I don't need the first option to be selected anyway :)

lucasnetau commented 10 months ago

@kevinchappell this is handled by formRender and the extra selected option has no effect. Should we close this or we you wanting to have the radio buttons on the edit field Options container disappear when a placeholder is set?