0

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.

thanks

paul

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by vibhaJ
0

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

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

You can also use below reduced code.

<option <?=($question1 == "Gone to Competitor")?'selected="selected"':''?> >Gone to Competitor</option>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.