Page 1 of 1

Problem with drop down box

Posted: Fri Sep 25, 2009 2:27 am
by om.bitsian
Hello friends
To retain value on PHP form , when i refresh page i am using
<option value="4" <?php if ($_POST['emptyp'] == '4') { echo "selected='selected'"; }?> >1. (Helping staff)</option>
but its giving Notice: Undefined index 'emptyp'

please check the attached bmp file

please suggest me what to do to retain the values on php form for drop down

Re: Problem with drop down box

Posted: Fri Sep 25, 2009 3:51 am
by iamngk
add isset function :

Code: Select all

<option value="4" <?php if (isset($_POST['emptyp']) && $_POST['emptyp'] == '4') { echo "selected='selected'"; }?> >1. (Helping staff)</option>

Re: Problem with drop down box

Posted: Fri Sep 25, 2009 3:59 am
by om.bitsian
thanks iamngk....its working
by mistake i have post the same problem twice