Hi all,

I'm building a questionnaire and would like to know how i can get a selected option to stay selected after clicking submit.



ive tried the following, but not the final solution yet.

<option<?php if ($question1 == "Gone to Competitor"){ 
						echo "selected=\"selected\""
						?> >Gone to Competitor</option>

You can also use below reduced code.

<option <?=($question1 == "Gone to Competitor")?'selected="selected"':''?> >Gone to Competitor</option>