Skip to content

Commit

Permalink
feat(layout): Cater for multi-select values
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Nov 11, 2024
1 parent 5bd3fca commit 9e89439
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/layout/ModelForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,20 @@ const ModelForm = ({

let field_value = e.target.value

if( e.target.type === 'checkbox' ) {

if( e.target.multiple ) {

field_value = []

for( let selected_option of e.target.selectedOptions ) {


field_value.push(selected_option.value)

}


} else if( e.target.type === 'checkbox' ) {

field_value = e.target.checked

Expand Down

0 comments on commit 9e89439

Please sign in to comment.