以下是我的查询结果,该查询已发布到我的地址页面。这是使用 ajax 调用的 php 完成的。
<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">
<div id="report-address">3927 COCOPLUM CIR <br>
Unit: 35124<br>
COCONUT CREEK, FL 33063</div>
<div id="report-button">
<form action="report.html">
<input name="property-id[]" type="text" class="property-id" value="64638744">
<input name="submit" type="submit" value="View Report">
</form>
</div>
<div id="clear"></div>
</div>
<div id="address-wrap">
<div id="report-address">3949A COCOPLUM CIR <br>
Unit: A<br>
COCONUT CREEK, FL 33063</div>
<div id="report-button">
<form action="report.html">
<input name="property-id[]" type="text" class="property-id" value="64639105">
<input name="submit" type="submit" value="View Report">
</form>
</div>
<div id="clear"></div>
</div>
<div id="address-wrap">
<div id="report-address">3949 COCOPLUM CIR <br>
Unit: 3602<br>
POMPANO BEACH, FL 33063</div>
<div id="report-button">
<form action="report.html">
<input name="property-id[]" type="text" class="property-id" value="64639106">
<input name="submit" type="submit" value="View Report">
</form>
</div>
<div id="clear"></div>
</div>
<div id="address-wrap">
<div id="report-address">3949 COCOPLUM CIR <br>
Unit: 3603<br>
COCONUT CREEK, FL 33063</div>
<div id="report-button">
<form action="report.html">
<input name="property-id[]" type="text" class="property-id" value="64639107">
<input name="submit" type="submit" value="View Report">
</form>
以下是我的报告页面上的请求。我需要从表单中获取值并将其传递到我的报告页面,以便我可以附加我的 ajax 请求。
<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>
我的主要问题是我没有从我点击的表单中获得价值。它给了我列表中的第一个值 64638716。我怎样才能让它附加正确的值
先感谢您