Wondering how I can get if the value of a checkbox if it's checked then I want it be stored in a PHP session if possible.
Not sure this can be done. Hence the question on here!
Here's a small/important part of the code I have.
<div class="accessories-right">
<h3><?php echo $row['title'] ;?></h3>
<p><?php echo $row['description']; ?></p>
<div style="width: 700px; float: left; min-height: 20px;">
<div id="ck-button">
<label>
<input type="checkbox" value="1" style="visibility: hidden;" name="checked" class="box" id="box"><span>SELECT</span>
</label>
</div>
<div class="accessories-text"><?php echo $row['price']; ?></div>
</div>
</div>
<div style="margin: 20px 0px 40px 0px; padding:0; clear: both;"></div>
<div style="float: left; margin: 3px 0px 0px 760px;">
<button class="green-btn" id="more">Continue »</button>
</div>
The button has an ID and I have tried something like stated below: But I need it to be on the same page and store in a session to use later.
$(".success").hide();
$(".error").hide();
$("#more").click(function() {
var checked = $("#box").val();
var dataString = 'checked='+ checked;
if(checked == '')
{
$(".success").hide();
$(".error").show();
}
else
{
$.ajax({
type: "POST",
url: "accessories_post.php",
data: checked,
success: function() {
$(".success").show();
$(".error").hide();
}
});
}
return false;
});
But this isn't really doing what I want it to do.
Sorry I also forgot to add that I'm wanting to like select multiple items then add them to a mail() function to email this info off to the client.
So i'd like to select either or of these items then have it sent to the client via email