You are here: RE: [PHP] Modifying data in forms with values « PHP « IT news, forums, messages
RE: [PHP] Modifying data in forms with values

Posted by info on 09/14/05 09:43

Robert,
Murray's suggestion is good. Here is some code to produce the current value of 'county' in a select list:


<!-- START of counties.php -->
<?php $_REQUEST['county'] = !isset($_REQUEST['county'])? NULL:$_REQUEST['county']; // initialize or capture ?>
<select name="county">
<option value="<?php echo $_REQUEST['county'];?>" SELECTED><?php echo $_REQUEST['county'];?></option>
<!-- Add, remove or change any of the select option items below: -->
<option value="Aberdeenshire">Aberdeenshire</option>
<option value="Angus">Angus</option>
<option value="Argyll & Bute">Argyll & Bute</option>
<option value="Avon">Avon</option>
<option value="Ayrshire">Ayrshire</option>
<option value="Bedfordshire">Bedfordshire</option>
<option value="Berkshire">Berkshire</option>
<option value="Borders">Borders</option>
<option value="Western Isles">Western Isles</option>
</select>
<!-- END of counties.php -->


Here's a basic select list article:
http://www.globalissa.com/articles/articleSelectList.php

Dave.
http://www.globalissa.com
===

> I have to create registration forms all the time for people in the office
> and
> what I keep running into is that I need a way for when they edit a field
> that
> the drop-down list of choices is automatically set for the right now.
>
> I have 100+ counties in one list, but I don't want to write 100+ if
> statements
> for checking to see if the value of $county equals the value of the field
> I am
> drop down choice.
>
> Anyone have some quick solutions?
>
> I have radio buttons as well, but going to use a drop-down list for the
> editing
> pages to make it all simple.
===

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация