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

Trying to hard code the lead owner in web to lead form

I have created a web to lead form and I am trying to hard code the lead owner. The code I am using is below. The form seemes to work fine but the lead owner is always "crm crm"

Any help would be great.


Thanks Brian


<input type=hidden name="lead_owner" value="Bill Smith ">




Instead of assigning the owner name use owner id (Salesforce id) or you can query the owner of the lead in your custom controller and then assign owner 


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 


No not really,  I just need to know if this would be the code then "<input type=hidden name="saleforceID" value="Bill Smith ">"


Thanks so much Brian


nope this wont be the solution. As owner is the lookup u need to refer with the respective ID u need to pass the ID of the respective user..

Andy BoettcherAndy Boettcher

I would attack this by creating a custom text field called "autoOwner" or something like that.  You can specify that field in your basic Web-To-Lead form generator.  Pre-populate the field in your HTML form with a static value - "Hooahh" or whatever.


Then - using Lead Assignment Rules - key off of that field and properly assign the Owner that way.