I wish to add an element to my website, but don't know how. Can anyone offer up a solution?
What I want to do is have a table in the middle of my page containing a form for the user to fill. The table needs to look like a series of "stacked" file folders with tabs on the top. When the user hits SUBMIT, the current file folder tab will go to the back, and the next successive tab will come forward, presenting the next form in succession.
Any idea how to get this "file folder" effect? It doesn't even need to look like folder tabs, just blocks at least. I'm just trying to get some sort of cascading effect. Ideally the user could click one of the tabs on the top to go back to a previous page.
Any help would be just grand. Thanks!
Tricky Border Problem
Moderator: General Moderators
- artexercise
- Forum Commoner
- Posts: 33
- Joined: Thu Nov 20, 2003 9:38 am
- Location: Raleigh, NC
no, I don't think that's what he's asking for.
What I would do is have a big php file that contains a separate html page for each tab and have a big conditional that reads $_POST["step"] to know which page to display. On each successive page previous input (and the current step) is stored in hidden input tags. So then you just have something along the lines of: (this would be the code for the "step 4" branch of the main conditional. step 1 was name, 2 was age, 3 was birthday, 4 -the last step- is username)
Of course, for previous steps you would need lines similar to
And you'd also have to conditionally write the hidden attributes in the main tr/td in previous steps based on whether you actually have the values to make sure data is preserved if you return to the 3rd step after completing it and going back to the 2nd step.
And the final branch of the conditional, "finished", would need to be different of course.
It would be possible but fairly difficult and very hard to maintain to construct a series of conditionals so that there's only one main layout (instead of copying it 4 times for the different steps) and the hidden fields/main td are outputted as appropriate to the current step.
Remember to remove the hidden inputs in the sendTo form for previous steps, whether or not you choose to make it all one layout with conditional segments.
I should charge for this -_-
What I would do is have a big php file that contains a separate html page for each tab and have a big conditional that reads $_POST["step"] to know which page to display. On each successive page previous input (and the current step) is stored in hidden input tags. So then you just have something along the lines of: (this would be the code for the "step 4" branch of the main conditional. step 1 was name, 2 was age, 3 was birthday, 4 -the last step- is username)
Code: Select all
print <<<xxxendxxx
<form name="e;sendTo"e; method="e;post"e;>
<input type="e;hidden"e; name="e;name"e; value="e;$_POSTї"e;name"e;]"e;>
<input type="e;hidden"e; name="e;age"e; value="e;$_POSTї"e;age"e;]"e;>
<input type="e;hidden"e; name="e;age"e; value="e;$_POSTї"e;birthday"e;]"e;>
<input type="e;hidden"e; name="e;step"e; value="e;0"e;>
</form>
<table align="e;center"e; width="e;50%"e; height="e;500"e;>
<tr>
<td onclick="e;document.sendTo.step.value = 1; document.sendTo.submit()"e; align="e;center"e; valign="e;center"e;><a href="e;#"e;>Step 1</a></td>
<td onclick="e;document.sendTo.step.value = 2; document.sendTo.submit()"e; align="e;center"e; valign="e;center"e;><a href="e;#"e;>Step 2</a></td>
<td onclick="e;document.sendTo.step.value = 3; document.sendTo.submit()"e; align="e;center"e; valign="e;center"e;><a href="e;#"e;>Step 3</a></td>
<td align="e;center"e; valign="e;center"e; bgcolor="e;gray"e;>Step 4</td>
</tr>
<tr>
<td colspan="e;4"e; align="e;center"e;>
xxxendxxx;
print "e;<br>Username: <input type=\"e;text\"e; name=\"e;username\"e;"e;;
if ($_POSTї"e;username"e;]) print "e; value=\"e;{$_POSTї'username']}\"e;"e;
print "e;<"e;;
print <<<xxxendxxx
<input type="e;hidden"e; name="e;name"e; value="e;$_POSTї"e;name"e;]"e;>
<input type="e;hidden"e; name="e;age"e; value="e;$_POSTї"e;age"e;]"e;>
<input type="e;hidden"e; name="e;age"e; value="e;$_POSTї"e;birthday"e;]"e;>
<input type="e;hidden"e; name="e;step"e; value="e;finished"e;>
<input type="e;submit"e; value="e;Submit"e;>
</td>
</tr></table>
xxxendxxx;Code: Select all
print "e;<br>Username: <input type=\"e;text\"e; name=\"e;username\"e;"e;;
if ($_POSTї"e;username"e;]) print "e; value=\"e;{$_POSTї'username']}\"e;"e;
print "e;<"e;;And the final branch of the conditional, "finished", would need to be different of course.
It would be possible but fairly difficult and very hard to maintain to construct a series of conditionals so that there's only one main layout (instead of copying it 4 times for the different steps) and the hidden fields/main td are outputted as appropriate to the current step.
Remember to remove the hidden inputs in the sendTo form for previous steps, whether or not you choose to make it all one layout with conditional segments.
I should charge for this -_-
check's in the mail
Thanks, that's exactly what I was hoping for. After I make my first billion, I'll buy you an island in the mediterranean 
Brad
Brad