I am pretty new at ajax/jquery so I've copied and modified my existing code to try and work. I cant seem to get both WO and Comments to post to my php file (which contains SQL). Right now It does nothing. Use of the following only allows it to send the WO but comments remains blank.
data: 'wo='+wo,
I've even tried
data: {'wo='+wo, 'Comment='+Comment},
HTML:
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<p>WO notations appear at the top of the work order screen. Only submit useful information that can be provided to builders/centerpoint. Other importation information may include bricks, scaffles, dogs, or home owners preventing installation. Be sure to include phone numbers if available.</p>
<label>Information</label>
<div>
<input class="form-control" placeholder="Enter more information here" type="text" name="Comment[]">
</div>
</div>
<button type="submit" name="notation" class="btn btn-default" onClick="AddNotation(<?php echo $_POST['results']; ?>);">Submit Button</button>
<button type="reset" class="btn btn-default">Reset Button</button>
</div>
</div>
</div>
Jquery:
<!-- Notation -->
<script>
function AddNotation(wo)
{
jQuery.ajax({
type: "POST",
url: "functions/woNotation.php",
data: {wo: wo, Comment: Comment},
cache: false,
success: function(response)
{
alert("Your notation has been added to this work order");
}
});
}
</script>
Commentdefined?