Reputation:
I'm really struck here. I have a form and i want to submit it and get value on other page in 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>
Now i want to get copy_id value in rentals.php with jquery not php
$(document).ready(function()
{
// here I want to get copy_id value.please note this is jquery so i want to get in jquery
});
Upvotes: 0
Views: 690
Reputation: 13019
These lines in rentals.php will do the trick :
<!-- This should be somewhere in the <head> but before your main script -->
<script type="text/javascript">
var copy_id_value = <?=$_POST['copy_id']?>;
</script>
Upvotes: 0