PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm having trouble finding/figuring out how to make a form that will create a dynamic number of checkboxes. I want to pull all records from a table and dynamically create a corresponding number of checkboxes on the form page. This will enable the user to add additional records to the table without ever manually coding another checkbox. Here's what I have (this code is within <form> and <td> tags):
skyrise85 wrote:I'm having trouble finding/figuring out how to make a form that will create a dynamic number of checkboxes. I want to pull all records from a table and dynamically create a corresponding number of checkboxes on the form page. This will enable the user to add additional records to the table without ever manually coding another checkbox. Here's what I have (this code is within <form> and <td> tags):
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]
you should try this code:
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]
Array keys need to be quoted though.. PHP is trying to find a constant by that name, not finding it, issuing a notice, and then finally looking for a key by that name in the array. You should concatenate the variable like so: