0

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.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jino
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.