September 07, 2010, 08:29:36 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Common questions answered here !
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: About multi-page forms  (Read 894 times)
zupidupi
Freshman
*
Offline Offline

Posts: 25


« on: October 12, 2008, 09:52:00 pm »

Hi folks,

I'm working on a form for my site, that should have two or more distinct pages. Which page to display, is determined by the user type. Something like

switch ($user) {
   case 1 : use_page(1);
   case 2 : use_page(2);
   case 3 : use_page(3);
}

Where and how should this be implemented?

Also, I already designed the pages, and had a Static text/HTML-element type on two of them. This contains a php-code- snippet that produces some html-stuff. I had two problems with this:

1) I can't move the text on the page - it's always stuck in the upper left corner.

2) The text shows on *all* the pages, not just the one I placed it in.

Any thoughts about these problems?

Thanks in advance,

   Mike
Logged
Bitsqueezer
Living Legend
******
Offline Offline

Posts: 1872



« Reply #1 on: October 13, 2008, 08:08:03 pm »

Hi Mike,

instead of "use_page(1)" you can use "ff_page(1)" if you want to realize this in Javascript. But you must first get the right value into $user.

But: This is no secure solution. If someone uses Firefox with Firebug or similar programs he can simply switch to every element he wants. So to be secure you must create four forms. One for checking the user type and redirecting to the right of the other three forms. As they do not contain stuff of the other two forms nobody can see what he shouldn't see.

1) You can surround your HTML text with a DIV tag and this one can be positioned like you want. The FF static text/HTML element can be moved like any other element because it already is surrounded by a DIV tag (like any other FF element).

2) If you printed the text with a script it is no real FF element and so FF doesn't "know" that it's on the page. Switching between pages means hiding and displaying groups of elements. As an own text is no FF element it will not be hidden by switching to another page.

Cheers,

Christian
Logged
zupidupi
Freshman
*
Offline Offline

Posts: 25


« Reply #2 on: October 13, 2008, 08:15:34 pm »

Hiya,

OK, thx Christian for your reply. I will have to do the php-solution, and design enough forms. The Piece API wiki at http://www.facileforms.biz/wiki/Piece_API_Reference is a little lacking...which function should I use to redirect to another form?

And I suppose that the user type checking should be done in Form pieces->Before form.

Cheerio,

    Mike
Logged
Bitsqueezer
Living Legend
******
Offline Offline

Posts: 1872



« Reply #3 on: October 13, 2008, 11:14:45 pm »

Hi Mike,

you're right, that's the way. Use ff_redirectForm("formname") for this job.

Cheers,

Christian
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF © 2001-2006 Lewis Media
| Terms of Use | Privacy | Sitemap |