I've been going insane the past 3 hours with this issue. I had this completely working.....and it actually still is, but on another page. The only issue is that on a different page it stops working. Here is the basic run down:
- User visit page, clicks on button, JavaScript ModalBox opens up.
- In the modal box is a form, which the user fills out and hits Send.
- The form action is itself so it returns and checks if isset() is true on the submit button.
This is the issue it seems. I got this working on another script, but it's over 5 pages long so here is the small script that I just can't for the life of me get to work:
<?php session_start(); ?> <html> <head> <?php if (isset($_GET['initForm'])){ echo 'Complete'; } ?> </head> <body> <?php echo ' <div style="padding:0;margin:0;float:left;height:120px;width:100%;"> <div align="center" width="50%" style="padding-top:2px;"><img src="images/step1.png"></div> <div align="center" width="50%" style="font-face:Arial; font-size:14px;padding-top:4px;">Which package are you interested in?</div> <div align="center" width="50%" style="font-face:Arial; font-size:14px;padding-top:6px;"> <FORM action="test.php" name="initForm" id="initForm" onsubmit="return false;"> <select name="packageName"> <option value="Weekend">Weekend - 4 Days/3 Nights</option> <option value="Weekday">Weekday - 5 Days/4 Nights</option> </select> </div> <div align="center" width="50%" style="font-face:Arial; font-size:14px;padding-top:6px;"> <input Type = "Submit" name="initForm" Value ="Send" onclick="Modalbox.show(\'test.php\', {title: \'Vacation Booking\', width: 600, params:Form.serialize(\'initForm\')}); return false;"> </FORM> </div> </div>'; ?> </body> </html> -----FIXED------Solution below:-------
^The tag had to be placed on the outermost part of the html and now I can access all the elements of the $_Get array, including the submit button. Can anyone explain why this is so picky? I want my 3 hours back. Well at least I'll hopefully never make a mistake like this again.
echostatement? There's not even any variable interpolation