DavidD95 Posted November 8, 2014 Share Posted November 8, 2014 (edited) Apologies for this because it's probably very simple, but I've never worked with JavaScript or PHP or anything before. So the website I am producing is to sell tickets for something. To purchase these tickets the user is required to click on the seats they want and it will pop up in a box on the left hand side confirming their seat selection and how much the ticket is. The website has to feature a "Reset Database" button which totally resets everything. No tickets are selected anymore, the user is logged out etc. I have this working fine. It also has to feature a "Cancel" button, which simply removes the seats the user has selected, but still keeps them logged in. How do I code this? This is what the "Cancel" button looks like on the Index page: <div id="theButtons"> <input type="button" value="Cancel Choices" title="Cancel Choices" onclick="cancel()" /> </div> And this is my code on the JavaScript page: function cancel(){var s = document.getElementsByTagName('space'); window.location="index.php"; } How do I get this working? Edited November 8, 2014 by DavidD95 Quote Link to comment https://forums.phpfreaks.com/topic/292359-how-do-i-make-my-cancel-button-drop-information-on-a-page/ Share on other sites More sharing options...
hansford Posted November 13, 2014 Share Posted November 13, 2014 You don't give us much to work with. Try the reset() function if you're just trying to reset the form. document.getElementById('your_form_id').reset(); Quote Link to comment https://forums.phpfreaks.com/topic/292359-how-do-i-make-my-cancel-button-drop-information-on-a-page/#findComment-1496453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.