First of all I want to thanks all of you guys for helping every day , answering questions. You have save me a lot of time and I have learn a lot.
I have let's say this buttons on a form.
<button type="button" value="Adventurous" name="adv" id="adv">Adventurous</button>
<button type="button" value="Discovery" name="disc" id="disc">Discovery</button>
<button type="button" calue="Easy-going" name="easy" id="easy">Easy-going</button>
When the user clicks on a button to specify how he feels in our example I have the follow code on jquery to change the state of the button as checked and change the class (to be shown with different colors etc)
$(".tailor_field .tailor_mood_btn button").click(function() {
var checked = $(this).attr('checked');
$the_image = $(this).find("img");
if(checked){
$(this).removeClass("mood_on");
$(this).attr('checked', false);
$the_image.attr("src", templateDir+"/images/btn_on.png");
}
else{
$(this).addClass("mood_on");
$(this).attr('checked', true);
$the_image.attr("src", templateDir+"/images/btn_off.png");
}
});
So when the user press submit I want to check on server side (php) which buttons the user clicked ?
Second I would like to insert the buttons dynamically. Ie to have a string on my DB, explode it to an array and loop each element to create the buttons etc. How I will know what to check if I don't know how many buttons will be and their names from the beginning ? Maybe with sessions (I would like to avoid it if there is another solution)?
Thanks a lot!