PHP code to get selected text of a combo box

前端 未结 7 1033
死守一世寂寞
死守一世寂寞 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:35

    Change your select box options value:

    
    

    You cann't get the text of selected option in php. it will give only the value of selected option.

    EDITED:

    
    

    ON php file:

    $maker = mysql_real_escape_string($_POST['Make']);
    $maker = explode("_",$maker);
    echo $maker[1]; //give the Toyota
    echo $maker[0]; //give the key 2
    

提交回复
热议问题