For example, the select box
<select>
<option selected="" value="">Please Select</option>
<option value='txt'>Text</option>
<option value='int'>Numbers</option>
<option value='bool' >Boolean</option>
</select>
has a string
$messageList=array ( 'txt'=>'text message', 'int'=>'int message',
'bool'=>'bool message');
What i would like to achieve is to display correspond message when the optition is select?
I don’t know php, but First I think you need to use
json_encodeto convert php array to a javascript object. http://php.net/manual/en/function.json-encode.phpAnd then in javascript,
Also you need a
class/idfor the select. because the above code will triggered when you change the option of any select box in the page.