How to get response of radio button (if it is checked or not) and store it into mysql database using node js?
10 Answers
New AnswerWebdevelopment
3/11/2020 8:42:07 PM
R_N10 Answers
New AnswerR_Chandra Have you written your submit file where you will send data to store in database? Check link to understand:- https://www.sitepoint.com/forms-file-uploads-security-node-express/ https://programmingmentor.com/post/save-form-nodejs-mongodb/ “Using Node.js & Express.js to save data to MongoDB Database” by Jennifer Bland https://link.medium.com/X7nsXNzVM4
R_Chandra I just created a webpage run with node.js, the webpage displays simple multiple choice for submission to node.js, store on sqllite. Check out the webpage and source codes. https://code.sololearn.com/WAKK667qwYa5/?ref=app https://github.com/cv2k10/radio-choices-node-submission Go through the codes to find your solution, ask me if any of the source code you don't understand.
app.post("/submit",function(req, res) { console.log(req.body) res.render('index',{title:'data saved', message :'data saved successfully '}) }) here index is my pug file and submit is id of submit button.
Calvin Why two script is written in index.html file.? I've not used script tag in my html file. Is it necessary?
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message