[FX.php List] Editing a repeating field using a list menu
    Bob Patin 
    bob at patin.com
       
    Fri Jul  7 22:44:18 MDT 2006
    
    
  
Hi,
I'm writing an interface that will edit a record which contains a 5- 
element repeating field; I want to use a list menu in the form.
I'm having trouble figuring out 2 things:
1) When I try to show the selected value (of the 5 that are in the  
value list) I instead get the same selected value shown 5 times in  
the list.
2) What do I call the menu form element so that it writes to the  
proper repetition?
Here's my code thus far:
<select name="Category">
<?php foreach($vlResult['valueLists']['categories'] as $key=>$value)  
{  /* THIS PULLS IN THE VALUE LIST */ ?>
<option value="<?php echo $value; ?>" <?php if($value=$itemData 
['Category'][0]){?>selected<?php } ?>><?php echo $value; ?></option>
<?php } ?>
</select>
When I remove part of the value list code, as follows, the value list  
shows up correctly, but without showing the currently-selected value:
<select name="Category">
<?php foreach($vlResult['valueLists']['categories'] as $key=>$value)  
{  /* THIS PULLS IN THE VALUE LIST */ ?>
<option value="<?php echo $value; ?>"><?php echo $value; ?></option>
<?php } ?>
</select>
So how do I show the currently-selected value (as it is stored in the  
record)?
If I want to write to Category;0, what do I call the menu?
Thanks,
Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060
    
    
More information about the FX.php_List
mailing list