Skip to content

Switch Disabled-Attribute based of the value of another input-field #741

Answered by moonwave99
Pia-Lueling asked this question in Web
Discussion options

You must be logged in to vote

Hey @Pia-Lueling ^^

Your handleDisabled is not checking whether the date is set or not! You could for instance:

function handleDisabled(event) {
  setIsDisabled(!event.target.value);
}

This way, is the date is set, disabled will be false, and the opposite otherwise. Let us know if it works!

(by the way, I would call the state [endDateDisabled, setEndDateDisabled])

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@JessicaLoers
Comment options

@Pia-Lueling
Comment options

@moonwave99
Comment options

Answer selected by ahohnsen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
3 participants