Log in

View Full Version : echoing value of checkboxes using php and javascript



sukanya.paul
12-09-2008, 01:56 PM
hi,
i have an array of checkboxes which i am calling from the database. onchecking each checkbox the value should be concanated to a variable.
say i have 3 checkboxes with values a,b,c if i check the first checkbox then a variable say $var should be = to a then if i check the second checkbox $var=a,b any idea how to achieve this?

Thanks in advance,
Sukanya

maneetpuri
12-11-2008, 12:25 PM
Hi Sukanya,

You will have to trap the onChecked event of the checkboxes and write a JS function which will reconstruct the value of this variable.

Hope this helps.

Cheers,

~Maneet Puri
Lexolution IT Services
Web Design & Development Services (http://www.lexolutionit.com)