OnChange issue
Answered
Savannah posted this in #help-forum
SavannahOP
Hey, so im using <Input> it works perfect, but when i am using onchange and value it just only allows one or 2 characters.
Answered by B33fb0n3
you need to first call your function. And the way you doing it rn is wrong.
That way it should work fine
- onChange={handleInputChange(setUtmMedium)}
+ onChange={() => {handleInputChange(setUtmMedium)}}
That way it should work fine
15 Replies
you need to first call your function. And the way you doing it rn is wrong.
That way it should work fine
- onChange={handleInputChange(setUtmMedium)}
+ onChange={() => {handleInputChange(setUtmMedium)}}
That way it should work fine
Answer
SavannahOP
Thank you.
happy to help
i would be very surprised if that actually worked
- onChange={handleInputChange(setUtmMedium)}
+ onChange={(e) => {handleInputChange(setUtmMedium(e)}}
not this one?
did it really work?
SavannahOP
Not sure I wasn’t on pc I’m trying it today
after reading your issues again, I think original one was okay I mean
onChange={handleInputChange(setUtmMedium)}
is fine I guessmaybe some logic is limiting the length?
SavannahOP
I’ve got no logics in place to limit length I’ll send screen recording if above doesn’t work.
SavannahOP
<Input
type="text"
id="utmMedium"
placeholder="Enter UTM Medium (e.g., social)"
value={utmMedium}
onChange={(e) => {
setUtmMedium(e.target.value);
}}
/>
type="text"
id="utmMedium"
placeholder="Enter UTM Medium (e.g., social)"
value={utmMedium}
onChange={(e) => {
setUtmMedium(e.target.value);
}}
/>
thats my code and it does that
@James4u not sure if ping's are allowed, i hope it is.