rschaft
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by rschaft
-
-
Oke, that's not what I need. It should be 01, 125, 150, A, B. Is this possible with the lay-out of the array?
-
I'm trying to use the array values to populate a selection list in a form. The intentio is to use all first values in the same list, the second values in aonthter list and so on.
-
Hi,
I'm trying to pass values from an array into a form. As a newbie, I've came up with the code underneath, but I want to pinpoint all the first values toward 1 selection list in the form. Any suggestions how to accomplish this?
Thanks in advance.
Ruud
<html>
<head>
<title>Test formulier</title>
</head>
<body>
<h2>Test formulier</h2>
<form action="test.php" method="post">
<p>
<?php
$prijzen = array(
array("01", "125","150", "A" => true,"B" => true),
array("02", "125","150", "A" => true,"B" => true),
array("03", "125","150", "A" => true,"B" => false),
array("04", "125","150", "A" => true,"B" => true)
);
?>
</P>
<select name="prijzen[]" id="prijzen" multiple="multiple" size="7" class="none">
<?php
while(list($key, $val) = each($prijzen)){
while(list($key2, $val2) = each($val)){
echo '<option value="'.$key2.'">'.$val2.'</option>'.PHP_EOL;
}
}
?>
</select>
</body>
</html>
Pass values array into form
in PHP Coding Help
Posted
Hi, Thanks for your comment.
I need
<option value="prijzen">01</option>
<option value="prijzen">02</option>
<option value="prijzen">03</option>