Jump to content

How do I make my "Cancel" button drop information on a page?


Recommended Posts

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 by DavidD95
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.