Monday 6 February 2017

How do I go about creating a form in HTML(ejs file), then validate it for empty fields, or an existing user then submit to the POST request?

I'd like to know how to initiate the certain javascript functions to make a label red or have a pop up saying an empty field etc with the twitter bootstrap.I have a form like so:
I have a route like so:app.post("/sign-up", function (req, res) { console.log(req.body); res.render('sign-up'); }); I'd like to know how to handle the form validation. Like if a space is empty, with Bootstrap javascript, I can make it red or have a pop up. How can I do this?

Submitted February 07, 2017 at 01:45AM by farhansyed7911

No comments:

Post a Comment