Jump to content


Photo

an interesting php problem regarding checkboxes


  • Please log in to reply
2 replies to this topic

#1 arunsuri

arunsuri
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 09 August 2006 - 01:25 PM

hello friends this is arun here

                            friends i m working on a project in php and facing some problem but i hope i got a solution here.

my problem : i have a invitees_present form which is connected to a database in mysql.
now when i run my page it retrives some names from the database and corresponding chack box.
now i have to check some selected check boxes and then store the values in database table. but on the onclick of check boxes at client side how i can save these values in database.one more thing to remember is that the number of checkboxes i got are dynamic in nature how i can named all these. is there any concept of array in html or otherthings i have to do .


                    help me ,your suggession can build a good project by me
                      thanks in advanced

                                                                                                                      arun

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 09 August 2006 - 01:51 PM

Do update the database from the client side you will need to use ajax. Its fairly easy.

you can indeed create arrays of elements in html : use name="chkbx[1]" , chkbx[2] etc.

Or just chkbx[] if you want these fields to auto generate their indices.
follow me on twitter @PHPsycho

#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 09 August 2006 - 01:55 PM

chkbox[] also works in php.
it will make the results an array for you to play with
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users