|
Tried everything I can think of... maybe this isn't possible:
I'm using Javascript to use a link to make a hidden DIV visible. This link and the DIV need to be in a header.html file that each page of the site loads with "require, and contains the code to set up a banner and links that appear on every page of the site.
Within the now hidden DIV, I want to use a FORM tag to create a couple of text boxes, and then use the method="POST" to loop and validate the text box entries. The code looks like...
<?php
$page = "... current page name ..." // this is set in the page before the
// header.html page loads
?>
<DIV id="hidden_div" class="hidden">
<?php
if (isset($_POST['submitted'])) {
-validation section -
} // End submitted
?>
<form action="...this is where I have a problem..." method="POST">
<input blah blah>
<input blah blah>
<input style="link" type="submit" name="submit" value="Continue" />
<input type="button" value="Quit" onClick="javascript:hide('hidden_div") />
<input type="hidden" name="submitted" value="true" />
</form>
</DIV>
Ordinarily I'd use action="{page name}" so the page would reload from the beginning. However, I can't do that because I can't figure out how to identify the current page within the Form tag. The current page is held in a $page variable. So I would need to create the 'action' tag that resolves $page to the actual page name. And even then, I'm not sure the now visible DIV would still be visible, and less sure that the validation section would be accessed properly.
The other thought I have is to use the "action" tag to loop to the beginning of the DIV... I don't know if that's possible, either. I've tried using an anchor. Didn't work for me.
I'm reasonably sure that there is a method to do what I want... maybe something completely different from my two thoughts.
I hope this is clear. Help, anyone?...
|