I have a week input
<input type="week" name="weeks" id="weeks">
I want to be able to select multiple weeks with this input. I tried the "multiple" parameter but it didn't work. Is there any way to do this?
I have a week input
<input type="week" name="weeks" id="weeks">
I want to be able to select multiple weeks with this input. I tried the "multiple" parameter but it didn't work. Is there any way to do this?
I think you can try this idea:
In your JS:
var weeks = [] //here store the weeks selected by the user;
function handler(e){
weeks.push(e.target.value)
}
In your HTML:
<input type="week" name="week" id="weeks" onchange="handler(event);">
<div class='weeks'>
<-- here you can display the selected weeks --!>
</div>
Show to the user only one input, and when he selects a week you save this week in the weeks array, and clear the week input to allow him to select another week.