java getoptionvalue_How to get option value in database

Option A

Option B

Option C

Option D

This is a set of 4 options to a question.

We need to get the selected answer into a database

[err,result] = await to(db.query('insert into result(reg_no,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,essay1,essay2,essay3) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)',[req.session.reg, req.body.q1.value, req.body.q2.value, req.body.q3, req.body.q4, req.body.q5, req.body.q6, req.body.q7, req.body.q8, req.body.q9, req.body.q10, req.body.essay1, req.body.essay2, req.body.essay3]));

But for no matter what option you click, you just recieve an 'ON' on the database. I want the option value to come. Eg. If i select option B, then i should have 2 in the database.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值