Email Form | Community
Skip to main content
Level 3
October 16, 2015
Solved

Email Form

  • October 16, 2015
  • 1 reply
  • 729 views

Hello,

I have an email form for error page. There are name, email and comment field in page. The email works perfect and send values by email.

I need to have 2 more fields which are hidden and report the broken link/unvalid url in our site and Ref URL the website which has link to this broken link.

Could you please let me know what is the best approach to add these 2 hidden field. I have created hidden fields, but I am not sure how to get those information in my email.

Frankly, where should I put my javascript for those fields:

<script type="text/javascript">

document.errorform.BrokenLink.value = window.location.href;

document.errorform.RefURL.value = document.referrer;

</script>

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

Just put that hidden form code in the JSP that posts the form fields to AEM. It would be the same way as posting any hidden form field to a server. See this StackOverflow thread for more information on how to post hidden fields:

http://stackoverflow.com/questions/9251301/how-add-new-hidden-input-fields-to-the-form-on-submit

You can always write your own form component and submit the data (including hidden form fields) to an AEM Sling Servlet too:

http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

Just put that hidden form code in the JSP that posts the form fields to AEM. It would be the same way as posting any hidden form field to a server. See this StackOverflow thread for more information on how to post hidden fields:

http://stackoverflow.com/questions/9251301/how-add-new-hidden-input-fields-to-the-form-on-submit

You can always write your own form component and submit the data (including hidden form fields) to an AEM Sling Servlet too:

http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html