我真的来到这里。我有一个表单,我想提交它并在Jquery的其他页面上获取价值:
<form id="rentals_form" name="popup_form" action="rentals.php" method="POST">
<input alt="" style="display:none;" id="copy_id" name="copy_id" type="text">
</form>
<button
class="save_button"
value="copy_listing_button"
onclick="document.forms[$('#copy_listing option:selected').val()+'_form'].submit();"
style="font-size:11px; padding:0 3px 0 3px;">
Go
</button>
现在我想在rental.php中使用jquery而不是php
获取copy_id值 $(document).ready(function()
{
// here I want to get copy_id value.please note this is jquery so i want to get in jquery
});
答案 0 :(得分:2)
2.在其他页面中注明该cookie。
答案 1 :(得分:0)
rental.php中的这些行可以解决问题:
<!-- This should be somewhere in the <head> but before your main script -->
<script type="text/javascript">
var copy_id_value = <?=$_POST['copy_id']?>;
</script>