<?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: Custom Input Mask for a valid URL - Reopened</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened</link>
		<description>Gravity Support Forums Topic: Custom Input Mask for a valid URL - Reopened</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 17:17:03 +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/custom-input-mask-for-a-valid-url-reopened" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-289708</link>
			<pubDate>Thu, 30 May 2013 12:11:15 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">289708@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;No problem, glad I could help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>draney on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-289699</link>
			<pubDate>Thu, 30 May 2013 12:09:16 +0000</pubDate>
			<dc:creator>draney</dc:creator>
			<guid isPermaLink="false">289699@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Looks like that works. Thanks!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-286594</link>
			<pubDate>Wed, 29 May 2013 11:30:35 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">286594@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Something like the following should check the two conditions. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if(substr($websiteLink,0,7) == &#38;#39;http://&#38;#39; &#124;&#124; substr($websiteLink,0,8) == &#38;#39;https://&#38;#39;){&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>draney on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-286590</link>
			<pubDate>Wed, 29 May 2013 11:25:52 +0000</pubDate>
			<dc:creator>draney</dc:creator>
			<guid isPermaLink="false">286590@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So here is the code I have to check for leading &#34;http://&#34; in custom field &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php  if((get_post_meta($post-&#38;gt;ID, &#38;#39;website_link&#38;#39;, true))) {
$websiteLink = get_post_meta($post-&#38;gt;ID, &#38;#39;website_link&#38;#39;, true);
if(substr($websiteLink,0,7) == &#38;#39;http://&#38;#39;){ ?&#38;gt;
&#38;lt;p&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;website_link&#38;#39;, true); ?&#38;gt;&#38;quot;&#38;gt;Click to view website &#38;amp;raquo;&#38;lt;/a&#38;gt;&#38;lt;/p&#38;gt;
&#38;lt;?php } else { ?&#38;gt;
&#38;lt;p&#38;gt;&#38;lt;a href=&#38;quot;http://&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;website_link&#38;#39;, true); ?&#38;gt;&#38;quot;&#38;gt;Click to view website &#38;amp;raquo;&#38;lt;/a&#38;gt;&#38;lt;/p&#38;gt;
&#38;lt;?php } } ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Can anyone help me modify this to look for &#34;http://&#34; OR &#34;https://&#34;   ?&#60;/p&#62;
&#60;p&#62;If user submits a URL in the format of domainname.com (without a protocol prefix) I want to automatically add  a prefix of &#34;http://&#34; so it will be a valid URL and the link will work.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>draney on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-221021</link>
			<pubDate>Tue, 23 Apr 2013 11:53:41 +0000</pubDate>
			<dc:creator>draney</dc:creator>
			<guid isPermaLink="false">221021@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@horne3754sg see the link above. The earlier thread solves that problem.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>horne3754sg on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-220360</link>
			<pubDate>Tue, 23 Apr 2013 01:44:34 +0000</pubDate>
			<dc:creator>horne3754sg</dc:creator>
			<guid isPermaLink="false">220360@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, I too am having an issue with validation and the site url, when a user adds sitename.com it is invalid, the http:// prefix is not auto added so if a user does not add the http:// then the url will not be valid and the email cannot be sent.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>draney on "Custom Input Mask for a valid URL - Reopened"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-input-mask-for-a-valid-url-reopened#post-219721</link>
			<pubDate>Mon, 22 Apr 2013 18:22:33 +0000</pubDate>
			<dc:creator>draney</dc:creator>
			<guid isPermaLink="false">219721@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We are getting occasional entries in our custom field input (website URL) that have the http:// but no address. In the earlier thread &#60;a&#62;http://www.gravityhelp.com/forums/topic/custom-input-mask-for-a-valid-url#post-164463&#60;/a&#62; we came up with a function to detect the absence of the http prefix and add it if needed to make it a valid URL and it seems to be working except that now we are getting the occasional prefix only which causes a broken link.&#60;/p&#62;
&#60;p&#62;I would like to determine how that prefix is getting there and prevent it? I would be a little surprised if users entered that much and nothing more.&#60;/p&#62;
&#60;p&#62;Is there a way to modify the earlier function and force the field to be blank if it only contains the http:// prefix?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
