pub icon indicating copy to clipboard operation
pub copied to clipboard

Make form submission verification and errors happen in real time using js framework; not when just submitted

Open DGKSK8LIFE opened this issue 5 years ago • 2 comments

DGKSK8LIFE avatar May 08 '20 20:05 DGKSK8LIFE

i like this idea, what do you think @aaron2212. Only thing i'd consider is that we will have to duplicate validation logic for both the frontend and backend. In scenarios where the validation rules change - where does the single source of truth come from? We could also consider only validating on frontend but this seems like although you'd have to question the integrity of the data being persisted. Anyways would be nice to be thoughtful however we decide to go about it.

roymoran avatar May 08 '20 21:05 roymoran

i like this idea, what do you think @aaron2212. Only thing i'd consider is that we will have to duplicate validation logic for both the frontend and backend. In scenarios where the validation rules change - where does the single source of truth come from? We could also consider only validating on frontend but this seems like although you'd have to question the integrity of the data being persisted. Anyways would be nice to be thoughtful however we decide to go about it.

You could just do validation with regex on the frontend with react or whatever. Would be much easier and with react apps, the user couldn't just edit the source and send fraudulent requests. And the data wouldn't need to be persisted? The requests, if validated, would happen after a button press, it's just the validation would be in real time. Ok Ty!

DGKSK8LIFE avatar May 08 '20 22:05 DGKSK8LIFE