Is it possible to embed more than one form to a separate template? Not working for me :-(
Posted: 01 May 2008 04:26 AM   [ Ignore ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hi there,

Hopefully this will be a quick one and I am just doing something really stupid somewhere.

I have two types of form set up using Freeform. Each one is in a separate template and each works fine if you hit the template and test it out. Great so far!

Next up I have a third template which embeds the two forms into it. This is where it all goes pear-shaped.

If I embed the two forms onto the one template then the first forms submit button doesn’t work but the second one does! LOLown:

Is there any obvious reason that I am missing for this?

Thanks for any help on this one.

Best wishes,

Mark

Profile
 
 
Posted: 01 May 2008 06:53 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3257
Joined  2006-10-18
Mark Bowen - 01 May 2008 04:26 AM

If I embed the two forms onto the one template then the first forms submit button doesn’t work but the second one does! LOLown:

Is there any obvious reason that I am missing for this?

I’d imagine that you haven’t missed anything obvious such as an ending form tag, etc....

So basically, your structure looks something like this:

Regular Template
- Embedded Template with Freeform Form 1
- Embedded Template with Freeform Form 2

 Signature 
Profile
 
 
Posted: 01 May 2008 07:42 AM   [ Ignore ]   [ # 2 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hiya,

Yep exactly like that. The form tags are being created by Freeform and are definitely in there so not that unfortunately. Do you really think that I would miss an end tag?!! wink

Seriously though no all the tags are there that need to be and the two forms render fine on the screen and to the html source code both within their separate templates and in the embedded version but in the all-in-one version only the second form will submit.

Any help with this would be great, thanks.

Best wishes,

Mark

Profile
 
 
Posted: 01 May 2008 07:47 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3257
Joined  2006-10-18
Mark Bowen - 01 May 2008 07:42 AM

Do you really think that I would miss an end tag?!! wink

Haha, not you Mark! LOL cheese rasberry
And if you did, I would hold it against you for a long time, haha LOL

That certainly is strange… I’ll give it a whirl myself and see if I can duplicate this smile

 Signature 
Profile
 
 
Posted: 01 May 2008 07:54 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3257
Joined  2006-10-18

Well, I can get it to work for myself…

What do both of your Freeform Loop beginnings look like? smile

 Signature 
Profile
 
 
Posted: 01 May 2008 07:54 AM   [ Ignore ]   [ # 5 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hi Pie Man (btw - what is your name?),

Thanks for looking into this for me. I will try some reduction testing on my site as well to see if I can spot anything weird going on but the code all validates fine and everything looks above board but will still reduce a little to see if there is anything weird going on that I can see.

I’ll let you know what I find, if anything grin

Best wishes,

Mark

Profile
 
 
Posted: 01 May 2008 08:09 AM   [ Ignore ]   [ # 6 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hiya,

I think I may have found the answer!

I think it might be to do with the Live Validation script that I am using on the page to ensure that people fill in the forms correctly. I set the forms up without the javascript validation and all works fine. On a very very reduced template I then added back in the validation and when I clicked the one forms submit button the second form fired up saying you can’t submit as you haven’t filled in the required fields. This wasn’t showing previously on my full template, not too sure why that was though.

Will have to look at why it is trying to validate both at once. If I can’t get it to work then I will probably just place the forms on different pages for now as I simply love using the Live Validation script wink

You can consider this figured out and if I figure out how to fix it so that you can have more than one form on a page that has Live Validation enabled on it then I will let you know in case anyone else wants to do that too.

Thanks for the help Pie Man (or whatever your real name is?)

Best wishes,

Mark

Profile
 
 
Posted: 01 May 2008 08:15 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3257
Joined  2006-10-18

Haha… Javascript.... Freeform’s worst enemy rasberry

Not sure if you would have dealt with this already, but by default freeform’s ID is “freeform”, but you can use the form_id="” parameter… that could be an issue if they’re the same ID… though, I’m sure you’ve already taken care of that wink

My real name is Pietholomew Man.. haha j/k LOL

Kelsey Martens smile

 Signature 
Profile
 
 
Posted: 01 May 2008 09:04 AM   [ Ignore ]   [ # 8 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Darn,

I knew that I did know your name somewhere in the back of my noggin!!

Yep you are quite right I had already added in the form_id="” parameter as I always do like to have separate IDs on everything especially where they are generated by the system so that ruled out that one. It is definitely the Javascript that is doing it as I can see on my reduced template that when I go to submit the first form then the fields in the second form go red showing that I haven’t filled them in. What’s weird though is that if I don’t fill anything in on either form and press the first forms submit button then all the fields in both forms go red but if I fill in the second form and go to submit it then it does. I would have expected it not to submit due to the missing information on the first form but seems that this is not true.

Some more debugging needed methinks!! May just spring off an e-mail to the developer of the script and see if he can think of anything as well. Will let you know how I get on.

Best wishes,

Mark

Profile