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
bryan.andersonbryan.anderson 

Site.com forms cannot be submitted if picklist field value contains commas

This behavior has occurred in both a client's org as well as my own dev org.

 

  • Both cases used Leads as the object to connect to.
  • Created custom picklist field with values that have commas such as "1,000"
  • Add field to form after granting access to Site.com site guest profile
  • Preview page, fill out required fields and select value for picklist field with comma values
  • Error is displayed: "The form can't be submitted because 1,000 isn't a valid picklist value. Select a valid value and try again."
  • Removing comma from picklist value allows submission
  • Other picklist values can contain commas, but the selected picklist value cannot contain a comma

Is this expected behavior? It seems strange to me that the picklist value is completely valid and allowed to be added in Salesforce and can be used for standard pages or custom visualforce pages.

 

There is another picklist field that contains apostrophes and that is valid and does not cause submission errors.

 

For now, I have told my client that the commas will need to be removed.

Vinita_SFDCVinita_SFDC

Hello Bryan,

 

You are right this is as per design. Commas are considered OR function in the picklist taht is why it is not working. If you wish to include commas in the picklist values then encompass each value in quotation marks.

 

Hope this helps!

 

 

bryan.andersonbryan.anderson

I tried your suggestion but changing the value to "1,000" or '1,000' and the Site.com form still returns with an error of either:

 

"The form can't be submitted because "1,000" isn't a valid picklist value. Select a valid value and try again."

 

or

 

"The form can't be submitted because '1,000' isn't a valid picklist value. Select a valid value and try again."

 

I would not think that there is something specific with how the Leads object is handled. It's not a dealbreaker exactly, but seems like an unexpected behavior.

 

Thanks for the reply!

Vinita_SFDCVinita_SFDC


Hello Bryan,

Thank you for the details! I believe you are using a visual force page in your site, please encode the special character (like comma). You can use encode methods to 'escape' them for passing in a form -- just like in normal HTML.

bryan.andersonbryan.anderson

I am purely using Site.com and no Visualforce pages are in use either directly or via an iframe. To be clear, this is concerning Site.com and not Force.com Sites.

Vinita_SFDCVinita_SFDC

Hello Bryan,

 

Please try escaping comma as either of following:

 

1\,000 for 1,000

 

or

 

"1,000" for 1,000

 

Please let me know if it works.

bryan.andersonbryan.anderson

Still no luck. Both return error as invalid picklist values when the form is submitted.