Previously, the value was in an input tag, and I could access it on the app.js page through the name field of the input tag. The type was set to submit.
I converted it to a
tag and now can't seem to figure out a way to access it in the app.js side.
The line of code:
<label class = "putItInLine" id="innerContent">Quote:
<p class = "putItInLine" type="text" name="quoteSelected">
{{quote}}
</p>
</label>
The app.js side is here:
const form = req.body;
if (form.userSelectionQuotePage === 'DELETE') {
// Id would come out as a string, so but in the database,
// we need it to be as integer, so thats why we've done typecasting
let id = parseInt(form.id);
quotes_db.run(`DELETE
FROM quotes
WHERE quote = ?`, form.quoteSelected,
function (err) {
if (!err) {
res.redirect('/quotes');
} else {
console.log('QUOTE NOT DELETED', err);
}
});
}
question from:
https://stackoverflow.com/questions/65866643/i-want-to-send-this-data-quote-to-the-app-js-side 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…