| | |
How to pre-select checkboxes in form?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Aug 2006
Posts: 4
Reputation:
Solved Threads: 0
Greetings,
I need help with preselecting checkboxes in a HTML form.
The first form has several checkboxes and then I post this to a php page which based on the checkboxes selected will send out emails. Each check box corresponds to an email address. After I send an email to selected people, I then at a later point would like to send an update email. The second form should be pulling up information regarding these checkboxes and select boxes accordingly.
The checkbox portion in the form looks like this!
I then post the above to a PHP page, which then inserts these values into mysql database. I use array_merge to merge the values into a string into a database. When inserted, it get inserted as john@email.com,rambo@email.com,everyone@email.com. My second form has the same checkboxes but I am clueless regarding reading the checkbox values back and checking the boxes automatically.
Please advise!
Thank you in advance,
- Gravis
I need help with preselecting checkboxes in a HTML form.
The first form has several checkboxes and then I post this to a php page which based on the checkboxes selected will send out emails. Each check box corresponds to an email address. After I send an email to selected people, I then at a later point would like to send an update email. The second form should be pulling up information regarding these checkboxes and select boxes accordingly.
The checkbox portion in the form looks like this!
PHP Syntax (Toggle Plain Text)
<INPUT TYPE=CHECKBOX NAME=dl[] VALUE=john@email.com>John <INPUT TYPE=CHECKBOX NAME=dl1[] VALUE=rambo@email.com>Rambo <INPUT TYPE=CHECKBOX NAME=dl2[] VALUE=everyone@email.com>Everyone
I then post the above to a PHP page, which then inserts these values into mysql database. I use array_merge to merge the values into a string into a database. When inserted, it get inserted as john@email.com,rambo@email.com,everyone@email.com. My second form has the same checkboxes but I am clueless regarding reading the checkbox values back and checking the boxes automatically.
Please advise!
Thank you in advance,
- Gravis
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
Use the "checked" option.
You'll likely want to bookmark this page:
http://www.w3.org/TR/REC-html40/interact/forms.html
A couple notes:
1. Always put your HTML options in quotes. If you get a space in the input field somewhere, it will interpret it up to the space.
2. Take care in placing the boxes to avoid ambiguity and save your users some trouble. Don't check them all "for" the user if the user is likely to uncheck them all.
PHP Syntax (Toggle Plain Text)
<INPUT TYPE=CHECKBOX NAME=dl[] checked VALUE=john@email.com>John
You'll likely want to bookmark this page:
http://www.w3.org/TR/REC-html40/interact/forms.html
A couple notes:
1. Always put your HTML options in quotes. If you get a space in the input field somewhere, it will interpret it up to the space.
2. Take care in placing the boxes to avoid ambiguity and save your users some trouble. Don't check them all "for" the user if the user is likely to uncheck them all.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
![]() |
Similar Threads
- MySQL Checkbox Multiple data Delete? (PHP)
- Checkboxes array (ASP)
- Select Box populates text field (JavaScript / DHTML / AJAX)
- Changing the colour of the arrows of a select menu in a form (HTML and CSS)
- owner form display problem (VB.NET)
- How to entice people to actually register? (Growing an Online Community)
Other Threads in the PHP Forum
- Previous Thread: Sending HTML message to Outlook
- Next Thread: Please Help! parse error, unexpected T_STRING
| Thread Tools | Search this Thread |
advanced apache api array beginner binary broken cakephp check checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms sorting source space sql startup stored syntax system table traffic tutorial unicode update upload url validator variable video web youtube zend





