function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael MMichael M 

Add hidden component to Web-to-Case generated HTML

Hello,
I have generated HTML for a form, with the native web-to-case feature. The form will be posted on several different websites, so I need to add another, hidden, element (field?) to the form, which captures the information of the web page from which the form was filled in. Can anyone assist? Thank you. 
Anil JAdhav 14Anil JAdhav 14
Hi Michael,

You can use following tag -
<input type="hidden" name="00N00000000X0xY" id="00N00000000X0xY" value="CustField">
Mention just type="hidden".

Let me know if this helps.
 
Michael MMichael M
Hi Anil, Are those name and id the id of the custom field? I need to be able to see the actual name of the URL from which the form was filled out. How will that tag capture that data? 
Anil JAdhav 14Anil JAdhav 14
Hi Michael,
You need to specify name of custom/standard field name in name and id property whose value you want to capture.
<input type=hidden name="nameofhiddenfield" id="nameofhiddenfield" value="XXXX">
Michael MMichael M
How would it actually capture that data though, if the field is hidden?
Anil JAdhav 14Anil JAdhav 14
Hi Michael,

Hidden fields are mostly used to capture static data.

Let's take an example, you have setup Web-to-Case. You have 'Channel' field that need to capture if case has been created from Web-to-Case then the value of Channel field will be 'Web'. So you won't give this field to UI to select it by customer.

In this scenario, you will take hidden input, name of the field will be Channel field API name and value will be 'Web'.
<input type=hidden name="Channel__c" id="Channel__c" value="Web">

Whenever Case will be created by using Web-to-Case then value of Channel field will be set to 'Web'.

This is one of the scenario where you will use hidden fields. Please let me know if you have any queries, else you can mark it as Best Answer.

Thanks.