barniegilly Posted April 21, 2011 Share Posted April 21, 2011 Hi I have a single page submission update page which incorporates 7 drop down menus and 2 text input fields, everything works fine with the data updating back to the database, the only thing is that when the page is updated all the drop down menus are updated which includes ones that I don't want updated? I need to only update the drop down menus that have been selected? but am unsure how I do it? This is the code from the page, sorry if its a mess but I am not that experienced at the moment. This is a snippet of one of the drop down menus <tr> <td class="heading">Current Status</td> <td><?php echo $statusdescrip ['status_description']; ?> <select name="status_id" > <?php $status_set = findstatus(); $statuslist = mysql_fetch_assoc ($status_set); ?> <?php do { ?> <option value="<?php echo $statuslist ['status_id']; ?>" ><?php echo $statuslist ['status_description']; ?></option> <?php } while ($statuslist = mysql_fetch_assoc ($status_set)); ?></select> <span class="compuls">*</span></td> </tr> Quote Link to comment https://forums.phpfreaks.com/topic/234390-user-updating-a-form-with-drop-down-menus-in-it/ Share on other sites More sharing options...
barniegilly Posted April 21, 2011 Author Share Posted April 21, 2011 I have been working on this and I have set a blank selection in my drop down lists o zero, therefore if I can omit any fields with zero I will not update the drop down lists that have not been selected this time. Therefore if I have a function in my form processing to omit zeros Is this an option, I hope I am thinking along the right lines? Quote Link to comment https://forums.phpfreaks.com/topic/234390-user-updating-a-form-with-drop-down-menus-in-it/#findComment-1204673 Share on other sites More sharing options...
spiderwell Posted April 22, 2011 Share Posted April 22, 2011 thats how I would do if it was me, but don't take my method as gospel. something along the lines of how you stated should be fine and in the processing code, if value == 0 then skip update. Quote Link to comment https://forums.phpfreaks.com/topic/234390-user-updating-a-form-with-drop-down-menus-in-it/#findComment-1204784 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.