Why is my PHP Script not working when JavaScript is switched on? (but only in certain browsers)
<p>I'm new to PHP (and web development in general) and have come across something that to me seems really, really bizarre!</p>

<p><strong>Background</strong></p>

<p>I am currently designing and developing an online enrolment form for my employer, a training company. The form consists of 3 pages - pages 1 and 2 are for data input whilst page 3 is a summary page with only one input, a box to check that the customer agrees to our T&amp;Cs. Page 3 also includes a box where calculations are made as to the price of the selected training course based on choices made earlier in the form.</p>

<p>The form displayed on page 2, and some of the text on page 3, changes depending on a choice made on page one - that is, whether they are paying for the course themselves or their employer is funding it. If they choose employer, they get one form, if they choose self funding they get a different one. However, both of these forms are contained within a single .php file, using session variables to decide which one should be displayed.</p>

<p>I am using sessions to transfer the data between the pages. Each page has been made sticky using session variables. Real-time validation is carried out using javascript on each individual page, then a final PHP validation check is run on the whole thing when the customer tries to submit the final page. Javascript is also used on page one to calculate the price of the course in real time so the customer can see how much he/she will be paying before proceeding further.</p>

<p><strong>The Problem</strong></p>

<p>I find this really strange:</p>

<p>In Firefox, everything works perfectly</p>

<p>In Internet Explorer, when JavaScript is turned off, everything is fine. But when JS is switched on, the PHP validation on the final page seems to go haywire, thus making it impossible to submit the form.</p>

<p>In Chrome, again when JS is switched off, everything works, but when switched on, I can't even get past the first page. Instead of loading the correct form for page 2, I just get a blank screen.</p>

<p>Can anyone help? This is my first major project and I've been working on it for weeks, coming up against all sorts of problems and tearing my hair out but managing to solve them. Now I'm completely stumped, when I'm almost within touching distance of completion!!</p>

<p>I can't post the code here as it's 3 separate documents and very complicated, but if you want to have a look at the form itself go to:</p>

<p><a href="http://testing.xenongroupadmin.com/testing/enrolment.php" rel="nofollow">http://testing.xenongroupadmin.com/testing/enrolment.php</a></p>

<p>I hope someone can help! Thanks very much!</p>
