<?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: Input on Single Line Text is cut off after</title>
		<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after</link>
		<description>Gravity Support Forums Topic: Input on Single Line Text is cut off after</description>
		<language>en-US</language>
		<pubDate>Sat, 11 Apr 2026 06:20:45 +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/input-on-single-line-text-is-cut-off-after" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40584</link>
			<pubDate>Wed, 09 Nov 2011 10:50:51 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40584@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Great.  I figured you'd need to do something with the data to convert it back, so if you are forwarding the notifications for processing, and can convert the value there, that's great.  Glad we got that working.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pstonier on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40570</link>
			<pubDate>Wed, 09 Nov 2011 08:10:01 +0000</pubDate>
			<dc:creator>pstonier</dc:creator>
			<guid isPermaLink="false">40570@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;No worries. Sorry for missing that originally.&#60;/p&#62;
&#60;p&#62;This will work fine. Thank you so very much! I really appreciate your hard work.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40553</link>
			<pubDate>Wed, 09 Nov 2011 02:26:59 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40553@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/input-on-single-line-text-is-cut-off-after#post-40002&#34; rel=&#34;nofollow&#34;&#62;did mention&#60;/a&#62; that I did not cover converting it in the notification.  It was a lot of work to get it to work here with three separate functions.  Looking at it again with fresh eyes, it would probably not be too bad to change it in the notification.  I didn't know if you sent it or needed to send it in the notification, so I didn't spend any time on it.  I was happy to bring it this far :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pstonier on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40521</link>
			<pubDate>Tue, 08 Nov 2011 17:57:39 +0000</pubDate>
			<dc:creator>pstonier</dc:creator>
			<guid isPermaLink="false">40521@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If it's going to be time consuming/difficult, we can work with this as is. The application that will read the email can be written to convert the hex back.&#60;/p&#62;
&#60;p&#62;Thanks again, guys. Chris, especially, you are a form superhero.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pstonier on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40515</link>
			<pubDate>Tue, 08 Nov 2011 16:51:12 +0000</pubDate>
			<dc:creator>pstonier</dc:creator>
			<guid isPermaLink="false">40515@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Actually, never mind. It is working in the entry view. I was missing it in the email notification.&#60;/p&#62;
&#60;p&#62;How hard is it to add a filter for the email notification part?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pstonier on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40512</link>
			<pubDate>Tue, 08 Nov 2011 16:06:37 +0000</pubDate>
			<dc:creator>pstonier</dc:creator>
			<guid isPermaLink="false">40512@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Good catch! I missed that part.&#60;/p&#62;
&#60;p&#62;&#60;strike&#62;I'm close!&#60;br /&#62;
It's converting to hexadecimal, but not converting back.&#60;/p&#62;
&#60;p&#62;dj21j&#38;lt;22j&#38;gt;djj&#38;lt;dk is returning this 646A32316A3C32326A3E646A6A3C646B&#60;/p&#62;
&#60;p&#62;The code I'm using is… (form id is 7 and input is 5)&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php

// &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/input-on-single-line-text-is-cut-off-after&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/input-on-single-line-text-is-cut-off-after&#60;/a&#62;
// this handles converting the entered value to hex for storage
//
// strtohex and hextostr functions lifted from here:
// &#60;a href=&#34;http://www.php.net/manual/en/function.hexdec.php#100578&#34; rel=&#34;nofollow&#34;&#62;http://www.php.net/manual/en/function.hexdec.php#100578&#60;/a&#62;
//
// gform_pre_submission_filter_7 &#38;lt;--- 7 for FORM ID 7
add_filter(&#38;#39;gform_pre_submission_filter_7&#38;#39;, &#38;#39;ch_strtohex&#38;#39;);
function ch_strtohex($form) {
	// input 5 is the form field I want to convert to hex
	$x = rgpost(&#38;#39;input_5&#38;#39;);
	$s=&#38;#39;&#38;#39;;
	// convert the submitted string to hex
	foreach(str_split($x) as $c)
		$s .= sprintf(&#38;#39;%02X&#38;#39;,ord($c));
	// assign the hex value to the POST field
	$_POST[&#38;#39;input_5&#38;#39;] = $s;
	// return the form
	return $form;
}

// retrieve hex and convert before displaying in the admin: single entry view
add_filter(&#38;#39;gform_entry_field_value&#38;#39;, &#38;#39;ch_hextostr_single&#38;#39;, 10, 4);
function ch_hextostr_single($x, $field, $lead, $form) {
	// run this code on form 7, field 5 only
	// FORM ID 7, INPUT ID 5
	if ($form[&#38;#39;id&#38;#39;] == 7 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 5) {
		$s=&#38;#39;&#38;#39;;
		foreach(explode(&#38;quot;\n&#38;quot;,trim(chunk_split($x,2))) as $h) {
			$s .= chr(hexdec($h));
		}
		// prevent rendering anything that looks like HTML as HTML
		return htmlspecialchars($s);
	}
	else {
		// not (form 7 and field 5), return the original value
		return $x;
	}
}

// &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/input-on-single-line-text-is-cut-off-after&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/input-on-single-line-text-is-cut-off-after&#60;/a&#62;
// retrieve hex and convert before displaying in the admin: entry list view
// note the different filter name here &#38;quot;entries&#38;quot;
add_filter(&#38;#39;gform_entries_field_value&#38;#39;, &#38;#39;ch_hextostr_list&#38;#39;, 10, 3);
function ch_hextostr_list($x, $form_id, $field_id) {
	// run this code on form 7, field 5 only
	// change to match your form values
	if ($form_id == 7 &#38;amp;&#38;amp; $field_id == 5) {
		$s=&#38;#39;&#38;#39;;
		foreach(explode(&#38;quot;\n&#38;quot;,trim(chunk_split($x,2))) as $h) {
			$s .= chr(hexdec($h));
		}
		// prevent rendering anything that looks like HTML as HTML
		return htmlspecialchars($s);
	}
	else {
		// not (form 7 and field 5), return the original value
		return $x;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;/strike&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40372</link>
			<pubDate>Tue, 08 Nov 2011 02:47:13 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40372@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It's OK to strip off the leading &#38;lt;?php so long as the code you paste in to functions.php is within  PHP tags (and not stuck in the middle of another function by mistake.)  If not, bad things will happen.&#60;/p&#62;
&#60;p&#62;You're putting the code in the correct file.&#60;/p&#62;
&#60;p&#62;Are you sure the field ID and form ID are both correct, on all lines?  Mine was form 60 and field 4, and I see that in the code you pasted, but I doubt those are your values.  They would need to be changed to match your form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pstonier on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40254</link>
			<pubDate>Mon, 07 Nov 2011 11:02:00 +0000</pubDate>
			<dc:creator>pstonier</dc:creator>
			<guid isPermaLink="false">40254@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm thinking that I must be applying the filter incorrectly.&#60;/p&#62;
&#60;p&#62;I did some further testing and it always worked like this…&#60;/p&#62;
&#60;p&#62;when I input &#34;21782&#38;lt;wjk&#38;amp;*&#38;gt;/dwd&#34;,&#60;br /&#62;
it returns &#34;21782/dwd&#34;&#60;/p&#62;
&#60;p&#62;and when I input &#34;21782&#38;lt;wjk&#38;amp;9jjijk&#34;,&#60;br /&#62;
it returns &#34;21782&#34;&#60;/p&#62;
&#60;p&#62;So the first filter didn't seem to affect anything either–therefore, I'm probably applying the filter incorrectly.&#60;/p&#62;
&#60;p&#62;The functions.php file that I'm pasting the code into is root/wp-content/themes/current_theme/functions.php. The only thing that I've been removing is the top &#38;lt;?php b/c dreamweaver shows a syntax error.&#60;/p&#62;
&#60;p&#62;The code for the functions.php file is here &#60;a href=&#34;http://pastebin.com/bMx9g7rs&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/bMx9g7rs&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks again for your help. I appreciate it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40004</link>
			<pubDate>Thu, 03 Nov 2011 23:58:58 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40004@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There are three functions in that code:&#60;/p&#62;
&#60;ol&#62;
&#60;li&#62;Convert the value to hex before storing it&#60;/li&#62;
&#60;li&#62;Convert back to ASCII before showing the list of entries&#60;/li&#62;
&#60;li&#62;Convert back to ASCII on the single entry view&#60;/li&#62;
&#60;/ol&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Input on Single Line Text is cut off after"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/input-on-single-line-text-is-cut-off-after#post-40002</link>
			<pubDate>Thu, 03 Nov 2011 23:51:25 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40002@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;How about this?&#60;/p&#62;
&#60;p&#62;Code:&#60;br /&#62;
&#60;a href=&#34;http://pastebin.com/G8JxeKp8&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/G8JxeKp8&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Form export:&#60;br /&#62;
&#60;a href=&#34;http://min.us/mbkHjgAT43&#34; rel=&#34;nofollow&#34;&#62;http://min.us/mbkHjgAT43&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Screenshot - entries list:&#60;br /&#62;
&#60;a href=&#34;http://min.us/mcl6hI0WI&#34; rel=&#34;nofollow&#34;&#62;http://min.us/mcl6hI0WI&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Screenshot - single entry view:&#60;br /&#62;
&#60;a href=&#34;http://min.us/m5L7Ky8wF&#34; rel=&#34;nofollow&#34;&#62;http://min.us/m5L7Ky8wF&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Please ask questions.  I added comments but if something is unclear, please ask.  Not covered here is the conversion of the value before notifications are sent.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
