Hi,

Currently I optimize my website. I would like to use php, javascript or ajax to implement the asynchronous action:

I have an array of checkboxes: <input type="checkbox" name="checkboxArray[]" value="checkboxValue" />I would like to add functions that when the user check a checkbox, diplay the checkbox value below the web page right after the action, if the user continues to check another checkbox, show both value.

so that the submition is made by the onclick event, not a submit button. How can I make it? Please help.

You can easily do this using jquery.

First add a class to the checkbox.
Then u have to loop through each checkbox using the jquery "each". U can use the classname of the checkbox for looping.

Then u have to write the code for getting the value of checkbox inside the jquery event:

$(".classname").click(function(){

var value = $(.classname:checked).val();
value = value + ", ";

});

This will give the comma seperated value of all the checkboxes that are checked.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.