The solution to get the value and text values of the dropdown box at the same time:
Add a <p> tag, the user selects an item and then assigns the item's text to him
Then accept the page to get the P variance to get the corresponding text value
Form Fill page:
<form action= "submit.php" method= "POST" > <div> <label for= "Workyear" > Working life <em>*</em> &L t;/label> <select name= "workyear" class= "weight190" id= "Workyear" > <option value= "0" >---Please select---</op Tion><option value=1> students </option><option value=2> Fresh graduates </option><option More than one year </option><option value=4> more than two years </option><option value=5> more than three years </option><option
Value=6> more than five years </option><option value=7> more than eight years </option><option value=8> more than ten years </OPTION> </select> <p class= "note" name= "Workyear_note" id= "Workyear_note" ></p> </div> </ Form> <script> $ ("#workYear"). Change (function () { //code ...
var workyear_note=$ ("#workYear"). Find ("option:selected"). Text ();
$ ("#workYear_note"). Text (workyear_note); });
</script>
PHP Get page submit.php:
$infobean-> Workindustryid = $_post[' workyear '];
$infobean-> workindustryname = $_post[' workyear_note '];
This is easy + successful resolution of the problem.