I have a form with dynamically created drop-down lists. I send ALL list 'states' back to the same page with a $_GET string so that the drop-down boxes still hold the user's selections as they continue to select from the remaining lists on the form. The $_POST action ONLY happens after all lists are selected.
However, one of the lists now needs to allow users to select more than one option.
The value of the selection box is now an array and while this is easy to process if the form action is POST, like so...
The same won't work if I use $_GET.
The $_GET string for example might look like this...
but the following code won't work:
Would anyone have an idea why?
I'd appreciate some help with this.
Maria
However, one of the lists now needs to allow users to select more than one option.
The value of the selection box is now an array and while this is easy to process if the form action is POST, like so...
Code:
$PHPArray = $_POST['formValue'];
foreach($PHPArray as $value)
{
echo $value;
....do stuff with each value
}
The $_GET string for example might look like this...
Code:
[URL unfurl="true"]http://localhost[/URL] etc/test.php?formValue=2&formValue=3
Code:
$PHPArray = $_GET['formValue'];
foreach($PHPArray as $value)
{
echo $value;
....do stuff with each value
}
Would anyone have an idea why?
I'd appreciate some help with this.
Maria