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

http://s1.postimg.org/glc705uzj/image.png

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

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -