I want to pass parameter that selected from html select tag to my controller (assign it to string "city")
what should i do to achieve this ?
–Visualforce–
<select>
<option value="" selected="selected" disabled="disabled">City</option>
<option value="City A">City A</option>
<option value="City B">City B</option>
<option value="City C">City C</option>
</select>
–Apex Class–
public String city{get;set;}
Best Answer
Use
<apex:selectlist>
and<apex:selectOption>
Use selected/disabled attribute of
<apex:selectOption>
Or
Use
<apex:inputHidden>