So I'm trying to pass simple form data from my file ResName.html
<head>
<form action="file:///E:/programs/portAppJavascript.html" method="post">
Name: <input id = 'name'>
<br>
Number of Reservations: <input type="text" id ='resseats' name="resseat">
<input type='submit' value="Choose Seats">
</form>
</head>`
to my file portAppJavascript.html
. I'm just trying to pass the number of reservations to a js variable below.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var isClicked = false;
var counter = 0;
var numSeatsBought = <?php $_GET['resseat'] ?>; //window.location.search; //change to get from other html page
var seatArray = new Array();
function clicked(clicked_id){
////////////////
var links = document.head.getElementsByTagName('link');
for(var link in links){
if(links.hasOwnProperty(link)){
var l = links[link];
if(l.rel === 'canonical'){
alert(l.href);
}
}
}
Why is it not passing the number to the javascript variable? How can I fix this?
numSeatsBought
is the variable that's not receiving the data correctly.