How can i validate the inputs ?

i don't want this to happen, because it is awful so can anybody help me fix this ? code : https://pastebin.com/NrVx2s9g
Pastebin
function addRow() { let name = document.getElementById("name").val...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
No description
8 Replies
shonen295
shonen295•10mo ago
What do you want to validate ? can you elaborate
samidev
samidevOP•10mo ago
sii i've created a user, but i dont want this to happen only when i add informations to the inputs add a user but not to be empty and add an empty user
b1mind
b1mind•10mo ago
start with html validation then in the backend have it return back if blank with w/e msg telling the user. If they somehow injected it not using the html form.
Jochem
Jochem•10mo ago
it's easier the other way around, otherwise you have to mess with the form just to get it to submit invalid data
b1mind
b1mind•10mo ago
I mean html fist no? its how I role anyway. simple required attrib and brrrrrrrr wanna add a little more use pattern="" ? 😄
Jochem
Jochem•10mo ago
I write it in stages, more basic functionality first than any language first so html, then some css, backend, then JS to talk to it, and then back to enhance everything
samidev
samidevOP•10mo ago
i added the required attrib but didnt even work a lil fr
kryrlo
kryrlo•10mo ago
when you have to apply required attribute in your input tag, all input tags must be placed within form tag. so that validation works well.
Want results from more Discord servers?
Add your server