skip to Main Content

Unable to get the list of checked checkboxes onsubmit – Javascript

I have a NextJS app where I have this form: <form id='roles-form' action='#' onSubmit={handleSubmit}> <ul className='h-56 overflow-y-auto p-3'> {roles.role.map((role) => { return ( <li key={role.roleId}> <div className='flex rounded p-3 hover:bg-gray-100'> <label className='relative inline-flex w-full cursor-pointer items-center'> <input type='checkbox' name='roles' value={role.roleId}…

VIEW QUESTION
Back To Top
Search