<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Add somekind of custom check on a simple 'Single Line Text'</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Add somekind of custom check on a simple 'Single Line Text'</description>
<language>en</language>
<pubDate>Sun, 03 May 2026 21:02:36 +0000</pubDate>

<item>
<title>MvdL79 on "Add somekind of custom check on a simple 'Single Line Text'"</title>
<link>https://www.machform.com/forums/topic/add-somekind-of-custom-check-on-a-simple-single-line-text#post-23280</link>
<pubDate>Fri, 15 May 2015 16:02:56 +0000</pubDate>
<dc:creator>MvdL79</dc:creator>
<guid isPermaLink="false">23280@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Sorry for the late reply Yuniar (was celebrating my birthday). :)&#60;/p&#62;
&#60;p&#62;Yeah, that's what I was looking for. Works perfectly! Many thanks for this solution. It will save us a lot of hassle on orders and mix-ups!&#60;br /&#62;
Thank you!
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Add somekind of custom check on a simple 'Single Line Text'"</title>
<link>https://www.machform.com/forums/topic/add-somekind-of-custom-check-on-a-simple-single-line-text#post-23267</link>
<pubDate>Thu, 14 May 2015 08:02:40 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">23267@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Having the code to automatically remove unwanted characters is too risky. However, I can help you with the code that simply check for those unwanted characters and display error message.&#60;/p&#62;
&#60;p&#62;Edit your &#34;machform/includes/post-functions.php&#34; file. Search around line 450 for this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if(&#38;#39;text&#38;#39; == $element_type){ //Single Line Text&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;below that line, you can add this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if(($form_id == 10203 &#38;#38;&#38;#38; $element_id == 1) &#124;&#124; ($form_id == 11901 &#38;#38;&#38;#38; $element_id == 1)){
					if(!preg_match(&#38;quot;/^[a-z0-9-]*$/i&#38;quot;,$user_input[$element_name])){
						$error_elements[$element_id] = &#38;#39;Incorrect domain&#38;#39;;
					}
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>MvdL79 on "Add somekind of custom check on a simple 'Single Line Text'"</title>
<link>https://www.machform.com/forums/topic/add-somekind-of-custom-check-on-a-simple-single-line-text#post-23265</link>
<pubDate>Wed, 13 May 2015 14:58:02 +0000</pubDate>
<dc:creator>MvdL79</dc:creator>
<guid isPermaLink="false">23265@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Small bump.
&#60;/p&#62;</description>
</item>
<item>
<title>MvdL79 on "Add somekind of custom check on a simple 'Single Line Text'"</title>
<link>https://www.machform.com/forums/topic/add-somekind-of-custom-check-on-a-simple-single-line-text#post-23257</link>
<pubDate>Mon, 11 May 2015 19:03:58 +0000</pubDate>
<dc:creator>MvdL79</dc:creator>
<guid isPermaLink="false">23257@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Yuniar (and other staff ofcourse)!&#60;/p&#62;
&#60;p&#62;I have a small question. I am redoing several order forms for one of our sites and I am running into a 'small' issue. I have created 3 order forms, created logic on all of these, setup prices and they finally work as it should, however during testing I noticed a small issue.&#60;/p&#62;
&#60;p&#62;I am using a 'Single Line Text' together with a 'Drop Down'. The 'Single Line Text' is used to enter the domainname (without TLD) where a customer can select the TLD (extension) in the 'Drop Down'. The 'Drop Down' has prices listed in them.&#60;/p&#62;
&#60;p&#62;While this works perfectly, if customer fills it in correctly, it's possible they make a mistake by typing &#34;thisdomainname.com&#34; (in the 'Single Line Text') and then selecting .eu (from the 'Drop Down'). This results in;&#60;/p&#62;
&#60;p&#62;a) wrong price ofcourse, since .com and .eu have different prices&#60;br /&#62;
b) wrong domainname for example: 'thisdomainname.com.eu'&#60;br /&#62;
c) having no clue what the customers wants, does he want a .com or .eu domainname&#60;/p&#62;
&#60;p&#62;Is there a way to add some checks to this element based on ID's?&#60;/p&#62;
&#60;p&#62;What I want is that it automatically checks this 'Single Line Text'-field on correct input. It should remove everything in front of the domainname (http://, www, etc.) and remove the TLD / extension from it, because the customer should select this from the 'Drop Down', so it will show the correct price for it. If correcting is not possible, maybe the customer should get a error message or something?&#60;/p&#62;
&#60;p&#62;For example, the customer enters 'http://www.anotherdomainname.eu'&#60;br /&#62;
It should remove 'http://wwww.' and '.eu' from it.&#60;/p&#62;
&#60;p&#62;I checked my 3 order forms I currently have and this would need to be applied to two of them.&#60;br /&#62;
It should apply to:&#60;/p&#62;
&#60;p&#62;- form id 10203 and element_1&#60;br /&#62;
- form id 11901 and (also) element_1&#60;/p&#62;
&#60;p&#62;I hope I explained myself correctly and hoping this will be possible. Please let me know when you have the chance.&#60;/p&#62;
&#60;p&#62;Oh, and I rather not replace fields on the forum, because of the logic schemes I have already setup. But if there is no other way...&#60;/p&#62;
&#60;p&#62;Thanks in advance.&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Michel
&#60;/p&#62;</description>
</item>

</channel>
</rss>
