I have the following post request. It's sending all other fields successfully. However, whatever I try it simply does not pick up the check box. I've tested the id with a click event and alert and it's definitely referencing the checkbox ok.
$.post("http://" + window.location.host + "/exec_messages_send.php",
{
receiver : $("#messages_receiver").val(),
title : $("#messages_title").val(),
body : $("#wysi_textarea_message_body").val(),
urgent : $("#messages_urgent").checked
}
This is the html, rendered with php:
echo "<input type=\"checkbox\" id=\"messages_urgent\"> Mark as <span class=\"label label-important\">Urgent</span>";
How do I get the value of the checkbox? I've already tried .val() and .attr('checked') and .checked and a few other methods...