<?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: forms don&#039;t validate after changing input type</title>
		<link>https://legacy.forums.gravityhelp.com/topic/forms-dont-validate-after-changing-input-type</link>
		<description>Gravity Support Forums Topic: forms don&#039;t validate after changing input type</description>
		<language>en-US</language>
		<pubDate>Thu, 16 Apr 2026 23:02: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/forms-dont-validate-after-changing-input-type" rel="self" type="application/rss+xml" />

		<item>
			<title>Richard Vav on "forms don&#039;t validate after changing input type"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forms-dont-validate-after-changing-input-type#post-341814</link>
			<pubDate>Mon, 24 Jun 2013 06:56:22 +0000</pubDate>
			<dc:creator>Richard Vav</dc:creator>
			<guid isPermaLink="false">341814@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yep the HTML5 date and time types are still pending support by the browser developers&#60;br /&#62;
&#60;a href=&#34;http://docs.webplatform.org/wiki/html/elements/input/type/date&#34; rel=&#34;nofollow&#34;&#62;http://docs.webplatform.org/wiki/html/elements/input/type/date&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://docs.webplatform.org/wiki/html/elements/input/type/time&#34; rel=&#34;nofollow&#34;&#62;http://docs.webplatform.org/wiki/html/elements/input/type/time&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Piet on "forms don&#039;t validate after changing input type"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forms-dont-validate-after-changing-input-type#post-341769</link>
			<pubDate>Mon, 24 Jun 2013 06:37:30 +0000</pubDate>
			<dc:creator>Piet</dc:creator>
			<guid isPermaLink="false">341769@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Richard, thanks for your reply.&#60;br /&#62;
Guess I learned something new today :) I honestly didn't know that.&#60;br /&#62;
I turned it on and that indeed works perfect, except not on the time fields.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Richard Vav on "forms don&#039;t validate after changing input type"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forms-dont-validate-after-changing-input-type#post-341736</link>
			<pubDate>Mon, 24 Jun 2013 06:29:46 +0000</pubDate>
			<dc:creator>Richard Vav</dc:creator>
			<guid isPermaLink="false">341736@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Rather than using that function I would go to the Gravity Forms general settings page and set 'Output HTML5' to 'Yes', which will automatically set the email, website and phone input types to the corresponding email, url or tel which mobile devices recognise and display the correct keyboard for.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Piet on "forms don&#039;t validate after changing input type"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forms-dont-validate-after-changing-input-type#post-341625</link>
			<pubDate>Mon, 24 Jun 2013 05:47:28 +0000</pubDate>
			<dc:creator>Piet</dc:creator>
			<guid isPermaLink="false">341625@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I read an interesting article over at CSS Tricks about making the form fields more suitable for smartphone / tablet input. &#60;/p&#62;
&#60;p&#62;To do so, I changed the input type of my email and phone fields as well as a single text field I am using for time with the gform_field_input filter (&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_input)&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_input)&#60;/a&#62;. &#60;/p&#62;
&#60;p&#62;This works perfect right up until the moment of submitting, then exactly for those fields I have changed the input type for don't validate anymore.&#60;/p&#62;
&#60;p&#62;Is there anything I'm missing here?&#60;/p&#62;
&#60;p&#62;The code I used is:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;/**
 * Add functionality to change input type Gravity Forms to optimize for tablets and smartphones
 * see article: &#60;a href=&#34;http://css-tricks.com/a-couple-of-best-practices-for-tablet-friendly-design/&#34; rel=&#34;nofollow&#34;&#62;http://css-tricks.com/a-couple-of-best-practices-for-tablet-friendly-design/&#60;/a&#62;
 * see GF help: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_input&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_input&#60;/a&#62;
 */

add_filter( &#38;#39;gform_field_input&#38;#39;, &#38;#39;cf_gf_input_types&#38;#39;, 10, 5 );
function cf_gf_input_types( $input, $field, $value, $lead_id, $form_id )
{
	//because this will fire for every form/field, only do it when it is the specific form and field
	// 4 forms all email fields
	if ( $form_id == 1 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 3 &#124;&#124; $form_id == 3 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 2 &#124;&#124; $form_id == 4 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 3 &#124;&#124; $form_id == 5 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 2 )
	{
		$input = &#38;#39;&#38;lt;input type=&#38;quot;email&#38;quot;&#38;gt;&#38;#39;;
	}

	// 4 forms all phone fields; 2 forms time field
	if (
		$form_id == 1 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 4 &#124;&#124; $form_id == 3 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 3 &#124;&#124; $form_id == 4 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 4 &#124;&#124; $form_id == 5 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 3
		&#124;&#124;
		$form_id == 1 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 15 &#124;&#124; $form_id == 4 &#38;amp;&#38;amp; $field[&#38;#39;id&#38;#39;] == 15   )
	{
		$input = &#38;#39;&#38;lt;input type=&#38;quot;number&#38;quot;&#38;gt;&#38;#39;;
	}

	return $input;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
