You need to sign in to do that
Don't have an account?
Nagarjuna Reddy.P
Default value for <Select> in LWC
Hi Guys,
I need to set a placeholder like "Select an option" for <select> tag in LWC, I found no useful links, Could you pleas guide me on this.
Here is my <select> code
<select name="Time Frames" class="select slds-select" data-label='timeFrames' data-index={index} onchange={onClickUpdate}>
<template for:each={itemList} for:item="item">
<option key={item.label} value={item.value} selected={item.selected}>{item.label}</option>
</template>
</select>
Here itemList has picklist values from wire property of getpicklistvalues.This code considering the first value as default from the picklist values.
I don't need to have that default value and need to select from the dropdown.
Thank you.
I need to set a placeholder like "Select an option" for <select> tag in LWC, I found no useful links, Could you pleas guide me on this.
Here is my <select> code
<select name="Time Frames" class="select slds-select" data-label='timeFrames' data-index={index} onchange={onClickUpdate}>
<template for:each={itemList} for:item="item">
<option key={item.label} value={item.value} selected={item.selected}>{item.label}</option>
</template>
</select>
Here itemList has picklist values from wire property of getpicklistvalues.This code considering the first value as default from the picklist values.
I don't need to have that default value and need to select from the dropdown.
Thank you.
Can you check at field level, If you have default picklist value when creation of record?
Thanks!!