<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: TypeError: value.replace is not a function</title>
		<link>https://legacy.forums.gravityhelp.com/topic/typeerror-valuereplace-is-not-a-function</link>
		<description>Gravity Support Forums Topic: TypeError: value.replace is not a function</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 21:39:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/typeerror-valuereplace-is-not-a-function" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "TypeError: value.replace is not a function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/typeerror-valuereplace-is-not-a-function#post-167850</link>
			<pubDate>Mon, 11 Mar 2013 12:44:02 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">167850@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the heads up! We will make this adjustment. You will see it in 1.7 Beta 2.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "TypeError: value.replace is not a function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/typeerror-valuereplace-is-not-a-function#post-164628</link>
			<pubDate>Fri, 08 Mar 2013 12:51:27 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">164628@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the report. I'll pass it on to our developers to look at.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cnsx on "TypeError: value.replace is not a function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/typeerror-valuereplace-is-not-a-function#post-164206</link>
			<pubDate>Fri, 08 Mar 2013 05:10:46 +0000</pubDate>
			<dc:creator>cnsx</dc:creator>
			<guid isPermaLink="false">164206@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I've got this javascript error while trying to edit one of my fields :&#60;/p&#62;
&#60;p&#62;Erreur : TypeError: value.replace is not a function&#60;br /&#62;
Fichier Source : &#60;a href=&#34;http://localhost/wp-admin/admin.php?page=gf_edit_forms&#38;amp;id=1&#34; rel=&#34;nofollow&#34;&#62;http://localhost/wp-admin/admin.php?page=gf_edit_forms&#38;amp;id=1&#60;/a&#62;&#60;br /&#62;
Ligne : 3283&#60;/p&#62;
&#60;p&#62;I'm using the following version of GravityForms : &#60;/p&#62;
&#60;p&#62;Version PHP 	5.3.6&#60;br /&#62;
Version MySQL 	5.5.9&#60;br /&#62;
Version de WordPress 	3.5.1&#60;br /&#62;
Version de Gravity Forms 	1.6.12 	&#60;/p&#62;
&#60;p&#62;And the field is a select prepopulated with Gravity Forms + Custom Post Types (&#60;a href=&#34;http://wordpress.org/support/plugin/gravity-forms-custom-post-types&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/support/plugin/gravity-forms-custom-post-types&#60;/a&#62;)&#60;/p&#62;
&#60;p&#62;It looks like the error comes from GetFieldChoices in js.php, line 866 you do this :&#60;br /&#62;
var value = field.enableChoiceValue ? field.choices[i].value : field.choices[i].text;&#60;/p&#62;
&#60;p&#62;which in my case returns a number (the id of my custom post type), thus value.replace is undefined for Int typed variables.&#60;/p&#62;
&#60;p&#62;Just replace this line with the following (cast to string) and we are good to go :&#60;br /&#62;
var value = field.enableChoiceValue ? String(field.choices[i].value) : field.choices[i].text;&#60;/p&#62;
&#60;p&#62;Any chance to see this error fixed in a next release ?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
