Problem with multi pages

Abruzzoitaly 24 Feb, 2009
Hi!
I'm trying to insert a multi pages form in my site.
I'm using the code posted in another thread:

<?php
$page = JRequest::getInt('page', '0', 'post');
$page++; // to get the current page
switch ($page) {
  case 1:
?>
    // show code for page 1 here
    <input type='hidden' name='page' value='1' />
<?php
    break;
  case 2:
?>
    // show code for page 2 here
    <input type='hidden' name='page' value='2' />
<?php
    break;
// repeat as needed
}
?>


and in the OnSubmit Before Box
    <?php
    $page = JRequest::getInt('page', '0', 'post');
    switch ($page) {
      case 0:
        echo "We've got a problem - this should never happen!!";
        break;
      case 1:
        $post =& JRequest::get('post');
        // process the first page
        ...
        // redisplay the form
        showform($post);
        // supress the email and db preocessing
        $error_found = true;
        break;
    // repeat as needed
      case n:
        // process last page and let continue to emails and db
        break;
    }
    ?>


After this line // show code for page 1 here i've insered the code for my forms, but i don't understand if i must insert a submit button to go to the second page or something else...

Con you help me? I'm a noob! 😀
Thanks a lot

Dario
Max_admin 24 Feb, 2009
Hi Dario,

I suggest you test this code first with 2 simple pages, each has 1 or 2 fields, if you still have the problem then I think that you didn't replace the code comments "//" with the correct data from your form, so post all your code here including the 2 simple pages code which you will use to test!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.