PHP code to get selected text of a combo box

前端 未结 7 1006
死守一世寂寞
死守一世寂寞 2020-12-10 08:42

I have a combo box named \"Make\". In that combo box I\'m loading vehicle manufacturer names. When I click SEARCH button I want to display the selected manufacturer name. Be

7条回答
  •  自闭症患者
    2020-12-10 09:36

    you can make a jQuery onChange event to get the text from the combobox when the user select one of them:

    
    

    When you select an option, it will save the text in an Input hidde

      
    

    After that, when you submit the form, just catch up the value of the input

    $Evaluation = $_REQUEST['EvaluationName'];
    

    Then you can do wathever you want with the text, for instance save it in a session variable and send it to other page. etc.

提交回复
热议问题