I am a total PHP newbie and need to figure out a way how to invoke a PHP method when user clicks a button. Here is my code for this:
Code: Select all
echo '<img src="http://10.242.225.201:8080/spacer.gif" height="0" width="400"><input type="submit" name="TourSubmit" value="Add to cart" onClick="CheckTourAvailability('.$val->outputIndex.')">'Right now I am using embedded JavaScript function CheckTourAvailability() that does window.open('file2.php?parameters=values) but when file2.php loads it does not have the object I need in file1.php and using include() in previous thread doesn't seem to work because it causes file1 load and file2.
All I need to find out is if I can call PHP function 'onClick' and pass Javascript values to it.
Thank you,
Victor.