Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 26797
  • Total topics 4868
  • Total members 6607
  • Our newest member
    tugal94

TOP POSTERS

Form Checkbox problems

All problems and developments related to PHP, Ruby on Rails & Co. are discussed and resolved here.
   

Form Checkbox problems

Postby TT_Mark » Thu Aug 13, 2009 9:14 am

I'm not even sure if this is possible, but here goes.

I have a form (http://www.digameloya.com/enviar_sms.php excuse the crappy layout, I'm just working on getting the damn thing working) which loads the users from a database and gives each user a checkbox which can be selected to send the email to them.

Unfortunately the only select/unselect all option I could find, required all of my checkboxes to be given the same name (stupid I know) so when i select multiple checkboxes, it only passes one value through $_POST. Is there an easy way to make it pass all checkboxes without renaming the checkbox?
User avatar
TT_Mark
Smashing <li>
 
Posts: 443
Joined: Tue Feb 10, 2009 6:27 am
Location: Sheffield, UK
   

   

Re: Form Checkbox problems

Postby TT_Mark » Fri Aug 14, 2009 5:35 am

No one at all?
User avatar
TT_Mark
Smashing <li>
 
Posts: 443
Joined: Tue Feb 10, 2009 6:27 am
Location: Sheffield, UK
   

   

Re: Form Checkbox problems

Postby arrow » Thu Aug 20, 2009 5:11 am

Try to make the name an array like
Code: Select all
<input type="checkbox" name="yourname[]" />

:sleep:
Maybe we can talk and not just speak...
User avatar
arrow
Smashing <hr />
 
Posts: 60
Joined: Mon Feb 09, 2009 6:23 pm
Location: Austria
   

   

Re: Form Checkbox problems

Postby TT_Mark » Thu Aug 20, 2009 9:36 am

Cheers, I should probably have said that I have fixed it now. This was the solution I had used so thank you anyway
User avatar
TT_Mark
Smashing <li>
 
Posts: 443
Joined: Tue Feb 10, 2009 6:27 am
Location: Sheffield, UK
   


Return to Server-side Scripting



Who is online

Users browsing this forum: No registered users and 1 guest