$_POST[] issue for select multiple
Posted: Wed Mar 07, 2018 5:12 pm
Hi from France
My livecode server code is:
<!DOCTYPE html><html><?lc
put "hello" & $_POST["cars"]
?></html>
When I post from a multiple select input with several options selected in the following html page:
<!DOCTYPE html><html><body>
<form method="post" action="mylivecodeserver">
<select name="cars" multiple >
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</select>
<input type="submit">
</form></body></html>
I only get (by $_post) the LAST selected option value.
I tried name="cars[]" for getting an array as cited in some php forums, but a "is not an array" empty value is returned.
What is wrong with not getting ALL selected values?
Thanks for your kind help
Regards from Jean-Marc
My livecode server code is:
<!DOCTYPE html><html><?lc
put "hello" & $_POST["cars"]
?></html>
When I post from a multiple select input with several options selected in the following html page:
<!DOCTYPE html><html><body>
<form method="post" action="mylivecodeserver">
<select name="cars" multiple >
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</select>
<input type="submit">
</form></body></html>
I only get (by $_post) the LAST selected option value.
I tried name="cars[]" for getting an array as cited in some php forums, but a "is not an array" empty value is returned.
What is wrong with not getting ALL selected values?
Thanks for your kind help
Regards from Jean-Marc