2 forms on one screen

prevent form data crossover and email field errors with multiple forms on one page.

Overview

The issue occurs when two forms on the same page share identical field names, causing submitted data to autofill the other form, and email fields display protective JavaScript code.
Ensure all field names are unique between forms. For the email field error, refer to the specific FAQ about JavaScript in email boxes. For AJAX submissions where only the form replaces, note that other on-page elements like display messages remain unchanged unless using a custom element for replacement.

Answered
br brentw 23 Oct, 2014
Hi,
I have two forms embedded in a Joomla page. When submitting one and the page refreshes, the autofilling of the second form takes the data from the submitted form and fills it out. Also the email address fields show errors HTML code and "the email address is protected from spambots"

Using ajax submit causes everything to work fine.

Thanks,
Brent
br brentw 23 Oct, 2014
Oh, I did notice one more thing:

Ajax submission doesn't replace the "Display Message" from the onload event, it just replaces the form.

Thanks,
Brent
Max_admin Max_admin 23 Oct, 2014
Answer
Hi Brent,

You can solve this problem by making sure that the fields names are different in both forms!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
br brentw 23 Oct, 2014
Did you happen to have any info on the ajax submission only replacing "form" and not the "display message"

example:


on load:
Display Message
Form

on submit:
Display Message



and the result after ajax submission shows on the page
onload. Display Message
onsubmit.Display Message
br brentw 23 Oct, 2014
That didn't quite display correctly. It was
onload
1. Display Message
2. Form

onsubmit
1. Display Message
Max_admin Max_admin 23 Oct, 2014
1 Likes
Yes, that's normal, when your submit the "Form" using AJAX, only the form is replaced by the response, if you have other actions output then this will not be replaced, an alternative is to use a "custom" element in your form in order to replace it!

Regards,
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.