Jump to content
Larry Ullman's Book Forums

Two Forms, One Page - Display Only One Form, Not Both


Recommended Posts

Hello there!

 

The thread referenced (at the bottom) covers how to display two forms on a single page.

 

However . . .

 

In the case referenced, both forms are visible on the page by default, and it is only *after* a submit has been detected that the script detects the form sent, and calls the appropriate code.

 

It seems possible to display only one of the forms based on a user's site visit status.

 

For example, assume a page contains code for both 'Form A' and 'Form B'.

 

What I'm looking for is:

 

1) When the user visits the page for the first time, 'Form A' is displayed by default, then;

 

2) On any subsequent visit to the page by the same user, during the same session, 'Form B' is displayed by default.

 

Of course, the submit still gets handled by the processing script, but that's already been covered in the thread referenced.

 

What's got me snookered is how to determe the visitors status (i.e., new or return visit) so that the appropriate form can be displayed.

 

 ~ David

 

Reference:

http://www.larryullman.com/forums/index.php?/topic/1362-two-forms-on-one-page/

Link to comment
Share on other sites

Does that help?

 

Indeed it does. Thank you.

 

And since there are already sessions at work, the task is conveniently accomplished.

 

Makes me wince to recall how profound the original question appeared at the time.

 

 ~ David

Link to comment
Share on other sites

I know how you feel though. When you don't know how to approach a new problem, a bunch of (very complicated) possibilities run through your head, but once you realize what to do, it's usually pretty simple.

Anyway, glad you got what you wanted.

Link to comment
Share on other sites

 Share

×
×
  • Create New...