Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Imagine I have:
[syntax="html"]
<select multiple name="members[]">
<option value="1001">Tom</option>
<option value="1002">Dick</option>
<option value="1003">Harry</option>
</select>If I write a js function that refers to this select how do I refer to it with the square brackets.
If I name it just members the js works, but when posted to a PHP page I cannot obtain the multiple values unless the select name can be interpreted as an array (hence the square brackets).
For example: a function that selects all options triggered by some event works as
Code: Select all
function allSelect()
{
List = document.form.members;
for (i=0; i<List.length; i++)
{
List.options[i].selected = true;
}
}I require both the js and to name the <select> for use in php.
Any assistance would be appreciated.
- Andrew
feyd | Please use [php],[/syntax]
Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]