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
Garrett SamuelsGarrett Samuels 

Web-to-Case form, code for populating case Subject field

I have a web-to-case form. I would like to add code that pre-populates the Subject field. Please help. 
Dipti DDipti D
You can pass the Subject field as a hidden field with a pre populated value in it. 
https://help.salesforce.com/HTViewSolution?id=000005680&language=en_US
Garrett SamuelsGarrett Samuels
So by that logic, it would be <input type=hidden name="Subject" id="Subject" value="Value">   ? 
Dipti DDipti D
Yes. That way, your Subject is not visible on the web, where as when a Case is created via W-to-Case - It populates the Case Subject to that 'Value'
Garrett SamuelsGarrett Samuels
Are you sure that's right syntax? I added it to the code and tested and it did not populate Subject. 
Dipti DDipti D
As far as I know it should pass the Subject field value. Not sure why it is not working. 
Dipti DDipti D
Please try this. 
 <input type=hidden name="Subject" value="Value"> 
Vijay NagarathinamVijay Nagarathinam
Hi Garrett,

Please use the following code in your web to case, I tried this code in my org, it will be working for me.
 
<label for="subject">Subject</label><input  id="subject" maxlength="80" name="subject" size="20" type="hidden" value = "Case Subject"/><br>

Let me know if you need any help regarding this.

Thanks,
Vijay
Admin System 16Admin System 16
Hi, try with subject in lowercase, I had the same issue and now, it's ok : <input type=hidden id="subject" name="subject" value="xxx">