A user of my WordPress Google Form plugin brought me an interesting problem to look at. He wanted to put two forms on one page. The forms were each placed in a DIV and then visible to the user based on which tab on the page was selected. The presentation isn’t really germane to the problem as under the hood the page had two forms on it.
However, there are still a couple of other things to sort out when more than one form is present which is why I haven’t released an update yet. These are the things I am struggling with:
- If the alert shortcode attribute is used, the alert from the first short code is always displayed. What is desired is the alert from the submitted form should be displayed.
- The HTML provided by Google which is used to build the form has a FORM element with an ID of “ss-form”. This is not an issue when there is only one form on the page BUT is technically invalid HTML when two elements have the same ID.
I am not sure what to do about the second issue. It wouldn’t be hard to manipulate the HTML so the FORM element ID is unique but I don’t know if it is used on the Google side and it could also result in CSS issues if rules have been defined based on #ss-form.
I am considering adding a new shortcode attribute to override the FORM element ID value. I think this is the safest way to do it but really know if there are any ramifications on the Google side until I try it.
While I am digging around in the code, I am also looking at CAPTCHA solutions. The lack of CAPTCHA is a bit of a problem with Google Forms and it isn’t a simple problem to solve. What do you do on multi-page forms? CAPTCHA on every page? CAPTCHA only on Submit page? I think the later but that is a little harder to detect.