mysql - How to get the selected option from a html <select> & insert into database? -
i have made html page data displayed database , have added field of "status" have 2 select option every student present in database. question how selected['present' or 'absent'] data every student field , insert database or variable
my code here
http://s11.postimg.org/7s09i58pf/untitled.png
here databse structure , html page
your html code <option>
incorrect. instead of name
in it, use value
.
readup: <option>
| mdn
to value of selected option, have use javascript:
var e = document.queryselector('select[name=status]') var struser = e.options[e.selectedindex].value;
then, use ajax send value php , add database using sql.
Comments
Post a Comment