Welcome Guest, Not a member yet? Register   Sign In
Yet another set_checkbox() validation re-population question
#5

[eluser]Yorick Peterse[/eluser]
[quote author="ram4nd" date="1279203104"][] behind variable name, is array. Or you can call chars from string. Not rude just a suggestion.[/quote]

And since the user is using an ARRAY of checkboxes, hence the [] behind the value of the name tag, this works perfectly fine.

Code:
<input type="checkbox" name="foo[]" value="foo" />
<input type="checkbox" name="foo[]" value="foo 1" />

This would result in the following POST array:

Code:
foo = Array(
[0] => foo,
[1] => foo 1
)

Also, the userguide actually states that you should use the brackets. So instead of acting you know anything, learn something.


Messages In This Thread
Yet another set_checkbox() validation re-population question - by El Forum - 07-15-2010, 03:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB