Dorian
(Dorian Workman)
April 26, 2023, 5:02pm
1
Hi everyone, Happy Wednesday!
I stumbled across this awesome implementation that @Joyce referenced in an earlier thread somewhere. Can anyone provide more details on how to go about implementing this please? The poster on twitter refers to using WeWeb “states”. Thanks!
gbeaudoin
(Gabriel Beaudoin | Néo Carbone)
April 26, 2023, 7:40pm
2
You could create a Javascript function that validates the input using a regex, and returns a bool value depending on whether the content matches the regex or not. Then, you use this return value to hide/show elements, change color, etc.
Dorian
(Dorian Workman)
April 26, 2023, 8:22pm
3
Thanks @gbeaudoin I’ll give it a try. Assuming I wanted to implement what is shown in the video, I would need 3 functions each with their own boolean output, right?
gbeaudoin
(Gabriel Beaudoin | Néo Carbone)
April 26, 2023, 9:23pm
4
Yes that’s correct. Or at least 3 different regex (which could be in the same function or not).
That can be tied to states, or to components directly.
1 Like
Dorian
(Dorian Workman)
April 26, 2023, 10:49pm
5
Tried and failed
If anyone can help I’d appreciate it!
Dorian
(Dorian Workman)
April 26, 2023, 11:35pm
6
@carri Are you the Carri from the twitter post? If you are, I’d really appreciate your help with this! What you implemented looks fantastic.
raydeck
(Ray Deck)
April 27, 2023, 1:33am
7
Maybe this helps a bit with implementing regex for your use case? Easy validation with regular expressions in weweb - Descript
4 Likes
Dorian
(Dorian Workman)
April 27, 2023, 1:41am
8
Once again you are a lifesaver @raydeck thank you! Its super simple when you know how…!
Quentin
(Quentin Durantay)
April 27, 2023, 8:37am
9
Hey @Dorian , do you have access to WeWeb Copilot?
I was thinking this might help for your use-case, as you could have asked WeWeb copilot to write this regex/function using a prompt
2 Likes
Dorian
(Dorian Workman)
April 27, 2023, 3:54pm
10
Hey @Quentin , no I don’t, but I just submitted a request to sign up. That would be awesome, thank you!
Dorian
(Dorian Workman)
April 27, 2023, 8:04pm
11
To close the loop, here is what I was able to implement. Fantastic stuff! WeWeb is an amazing platform. Thanks again @raydeck for your help.
5 Likes
raelyn
July 21, 2023, 2:53am
12
Hey Dorian do you still have that video? Can’t seem to view it anymore.
Trying to do something similar with my passwords
Dorian
(Dorian Workman)
July 21, 2023, 10:28pm
13
@raelyn No, so I recorded a new one for you.
1 Like
vivien
(Vivien)
October 18, 2024, 10:58am
15
Hello Dorian, the video is down again. I’m trying to replicate exactly that right now. It would be of a great help
Dorian
(Dorian Workman)
October 18, 2024, 10:40pm
16
Sorry it was a Loom and I must’ve deleted it to make way for newer videos!
1 Like