Having issues pulling the values put in a textbox with ajax and posting them to another .php file. Ive done this once before with a checkbox but wasn't able to duplicate my results. Here is the code for the text boxes in questions.
<div align = "right">
<div class = ='text'>
<span style="float:right;"><strong> Status Report Date</strong>
<label for="from">From</label>
<input type="text" id="from" name="from">
<label for="to">to</label>
<input type="text" id="to" name="to">
<div id="dates"></div>
These are my date picker boxes since I attached a datepicker script to them but figured they act as normal text-boxes.
Here is the script for grabbing values from the textboxes
$(document).ready(function(){
$('input[type="text"]').click(function(){
var from = $(this).val();
$.ajax({
url:"sortByDates.php",
method:"POST",
data:{text:text},
success:function(data){
$('#dates').html(data);
}
});
});
});
</script>
Here is the .php file I am trying to send the values to.
<?php
if (isset($_GET['pageSubmit'])) {
$firstDate= $_POST['from'];
$lastDate= $_POST['to'];
echo $firstDate;
echo $lastDate;
}