Forums

URL parameter on form URL

rlab 28 Feb, 2012
Hi,

I have a form that is on domain.com. When someone submits the form from domain.com I want the email addresses to reflect domain.com. I have a second site, domain2.com. On this site, I want to put an external link to the domain.com form, but instead of domain.com being used for the email addresses, I need to use email addresses from domain2.com (same with the subject line in the email template, it needs to reflect which site the user came from to submit the form). Normally, I would just add a URL parameter (/form&site=domain and /form&site=domain2 for example) that specifies the site, to the form link and when the form is submitted, get the URL parameter and use it to determine which site the form came from and modify the email address & subjuct values based on that. That works fine unless the user has an error in the form, like an incorrect captcha and the form is reloaded. When the form reloads, it uses the default URL and the extra URL parameter is lost. Do you have any suggestions on how this could be done? I can't just duplicate the form on domain2.com as it needs to use some information from domain.com.

This is on a Joomla 1.7.5 site using Chronforms 4.0RC3.11.

Any ideas on how to accomplish this would be appreciated.

Thank you.
GreyHead 29 Feb, 2012
Hi rlab,

Can you add the url to a hidden input in the form to preserve it when there is an error?

Bob
rlab 29 Feb, 2012
Hi,

When there is an error is there some block I can add to the form that will allow me to put the URL parameter in the hidden field? Can I put a custom code block in the On Fail block before the Event Loop that will allow me to set the hidden field.

Or would it be better to put a custom block in the On Load block that sets the hidden field? If that would work, would it be best to put it before the Show HTML and Load Captcha blocks or after?

Thank you for your suggestion.
GreyHead 29 Feb, 2012
Hi rlab,

would it be better to put a custom block in the On Load block that sets the hidden field?

Yes and before.

Bob
rlab 29 Feb, 2012
Hi,

Thank you for your help. I will give that a try.
This topic is locked and no more replies can be posted.