I have successfully executed a query and displayed the results on my address page using PHP and AJAX.
<div id="address-wrap">
<div id="report-address">3719 COCOPLUM CIR <br>
Unit: 3548<br>
COCONUT CREEK, FL 33063</div>
<div id="report-button">
<form action="report.html">
<input name="property-id[]" type="text" class="property-id" value="64638716">
<input name="submit" type="submit" value="View Report">
</form>
</div>
<div id="clear"></div>
</div>
<div id="address-wrap">
... (more similar code) ...
I am now trying to extract the value from the corresponding form upon clicking it, to use for an AJAX request to my reports page.
<script type="text/javascript>
var property-id = $('.property-id').val();
$.ajax({
url: 'http://www.domain.com/php/reports.php',
data: '?recordID=' + property-id,
success: function(data){
$('#results').html(data);
}
});
</script>
However, I am facing an issue where it always retrieves the first value (64638716) instead of the one I clicked on. How can I ensure that it appends the correct values?
Thank You In Advance