ok i have sort of made some progress, i read on some help fofums that
data: $("#note_form").serialize()
is a much better way of getting ALL the data from the form so i tried it and after tweaking some other things i get the prompt working correctly after the button is pressed. however i echo out my sql line from my addnote.php page and there is still nothing reaching the page as far as data. Is there something else im doing wrong? also i changed the method from get to post but it didnt seem to fix this issue so its probably something else im not seeing.
here is the full code for reference
<script>
function no_redirect(){
// var note_text=$('#note_text').val();
// var cnotes=$('#cnotes').val();
// var formData = "note_text="+note_text+"&cnotes="+cnotes;
$.ajax({
url : "addnote.php",
type: "POST",
// data : formData,
data: $("#note_form").serialize(),
success: function(data, textStatus, jqXHR)
{
//data - response from server
alert(data);
},
});
}
</script>
<form action="#######.php" method="POST" id="note_form">
<div class="span12">
<h4 style="color:#1577a6;">Notes</h4>
<input type="hidden" name="cnotes" id="cnotes" value="<?php echo $tempuser8[$u]; ?>"/>
<textarea class="field span12" id="note_text" name="note_text" type="text" rows="9" maxlength="10000"><?php echo $tempuser9[$u];?></textarea>
<!-- <input id="add_note" type="submit" class="pull-right" name="add_note" value="Add Note"></submit> -->
<a href="#" class="btn btn-info pull-right" onclick="no_redirect()">Add Note</a>
</div>
</form>
here is the php script
$con = mysqli_connect($host,$uname,$pass,$database) or die(mysqli_error($con));
$customer_notes = NULL;
$row = NULL;
$customer_notes = $_POST['note_text'];
$row = $_POST['cnotes'];
// $sql = "INSERT INTO userprofile
// (customer_notes)
// VALUES
// ('".$customer_notes."')";
$note_sql = "UPDATE users SET customer_notes='".$customer_notes."' WHERE id='".$row."'";
echo $note_sql;
echo "<br>";
$result …