Forums

Display two different forms (or links) on one page

karenj 04 Jun, 2008
How do I display multiple forms (2 different forms) on a Joomla page? Example: User clicks a link and it will display two different forms (or links to the forms). This is needed to organized more than one form on a single page.

Thanks!
Karen
GreyHead 04 Jun, 2008
Hi Karen,

Because ChronoForms writes it's own form tags you can't put both in the same form. You could I think use the ChronoForms mambot/plugin to add two forms to the same content page.

But reading your question - maybe use three forms with the first just having links to the two others?

Bob
karenj 04 Jun, 2008
Thank you. How would I have a link that then takes it to the other two? I am new to ChronoForms.

Thanks,
Karen
GreyHead 04 Jun, 2008
Hi Karen,

Just use normal html text or image links in the Form HTML box and turn the email off in the General tab. ChronoForms will display any html that you give it.

Can you say a little bit more about what you want to achieve?

Bob
karenj 04 Jun, 2008
Thanks,

If you go to http://da315.aisites.com/
and login as guest, guest

Go to "Score Forms"
The form on this page is what I want but I want to have different forms on the page (there will be many). So I am not sure if this page should somehow have links to the forms and those can submit to email. I do want the submits to go to email.

Thanks!!
Karen
karenj 04 Jun, 2008
Addition: Ultimately I could have folders first.

GAD Folder >
link one > form 1
link two > form 2

MAA Folder
link one > form 1
link two > form 2
GreyHead 05 Jun, 2008
Hi Karen,

Thanks for the link, that helps a lot - though I'm still not completely clear.

For the index page, you can use a list of links:
<h3>GAD Folder</h3>
<ul>
<li><a href="index.php?option=com_chronocontact&chronoformname=form_1">Form 1</a></li>
<li><a href="index.php?option=com_chronocontact&chronoformname=form_2">Form 2</a></li>
</ul>
. . .
These links each take you to a separate ChronoForms form.

If the forms are all 'similar' then it may be better to use a single form and to use a 'switch' code to tell ChronoForms exactly what to display. This is very powerful but a bit hard to explain in a short post.

The link page would be like this:
<h3>GAD Folder</h3>
<ul>
<li><a href="index.php?option=com_chronocontact&chronoformname=main_form&form_id=1">Form 1</a></li>
<li><a href="index.php?option=com_chronocontact&chronoformname=main_form&form_id=2">Form 2</a></li>
</ul>
. . .
These both call the same form but include a 'form_id' variable.

In the form code you pick up the 'form_id' variable and use that to control what is displayed:
. . . some headings . . .
<?php
switch ( $_POST['form_id'] ) {
  case 1:
    // code for form 1
  break;
  
  case 2:
    // code for form 2
  break;
}
?>
. . . some footer html
This approach allows you to write one form and one set of code to control a whole range of forms. This takes a little more thought up fornt but is much easier to create and maintain.

Bob
karenj 05 Jun, 2008
thanks. This is so complex. When you say index page. Do you mean I create an entirely new index.html page with those links? How do I have that index page be a part of a Joomla link that I create?
Apologies if this is not clear.

Thanks,
Karen
GreyHead 05 Jun, 2008
Hi Karen,

No, nothing so complex - I was just using (bad) short-hand to desrcibe the page with the list of links on it see your post #9187 here.

Bob
karenj 05 Jun, 2008
So how do I get to the index page that has the links to show up if a user clicked on the "Score Forms"? How do I get the index page to show up from there? Do I need to create the "Score Forms" button as some type of external link?

Thanks for taking the time
GreyHead 05 Jun, 2008
Hi Karen,

You have one Form - the "index form" - with a list of links to the other forms. You link the "index form" to the Score Forms menu item using a URL link in the menu manager. (You can see the form url in the ChronoForms form manager.)

Bob
karenj 05 Jun, 2008
Thanks. I think I got it.
Thanks again,
Karen
GreyHead 05 Jun, 2008
Hi Karen,

Great, try building it in simple steps.

Create the 'index' form in ChronoForms with just a couple of links in it.

The create one simplifed version of a score sheet and get them both working together.

Then you can go on and add more detail.

Bob
karenj 05 Jun, 2008
I think I did it a bit differently. Let me know if you think this does the same job.

Just go to the Score Forms link again

thanks!
GreyHead 05 Jun, 2008
Hi Karen,

That looks good to me, there's no *right* way, if it works for you that's perfect.

Bob
This topic is locked and no more replies can be posted.