insert into #__sfg_forms set `status`='1',`name`='Contact_custom',`description`='',`form`='<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<form name=\"Contact_custom\" ext_access=\"111\">\n  <database name=\"sfg_example_contactcustom\">\n    <map sfgfield=\"\" dbfield=\"id\" />\n    <map sfgfield=\"merchant\" dbfield=\"merchant\" />\n    <map sfgfield=\"first_name\" dbfield=\"first_name\" />\n    <map sfgfield=\"last_name\" dbfield=\"last_name\" />\n    <map sfgfield=\"email\" dbfield=\"email\" />\n    <map sfgfield=\"phone\" dbfield=\"phone\" />\n    <map sfgfield=\"subject\" dbfield=\"subject\" />\n    <map sfgfield=\"message\" dbfield=\"message\" />\n    <map sfgfield=\"file1\" dbfield=\"file1\" />\n    <map sfgfield=\"date\" dbfield=\"date\" />\n    <map sfgfield=\"file2\" dbfield=\"file2\" />\n    <map sfgfield=\"file3\" dbfield=\"file3\" />\n  </database>\n  <globalphp>\n    /*******************************************************************/\n/* SmartFormer Gold © Form PHP controller                                                     */\n/*                                                                                                                  */\n/* Product of IToris © 2009 http://www.itoris.com                                       */\n/*                                                                                                                  */\n/*******************************************************************/\n\n$form-&gt;getPostedValues();\n$form-&gt;data[\'date\'] = date(\"m.d.y\");\n $form-&gt;data[\'time\'] = date(\"H:m:s\");\n\n $error = \'\';\n if($form-&gt;submitter &gt; -1){\n\n	 for($i = 1; $i &lt;= 3; $i++){\n	 	if(!isset($form-&gt;files[\'file\'.$i])){\n	 		continue;\n	 	}\n	 	$file = $form-&gt;files[\'file\'.$i];\n	 	$ext = strtolower(pathinfo($file[\'name\'], PATHINFO_EXTENSION ));\n	 	\n\n		if(!($ext == \'gif\' || $ext == \'jpeg\' || $ext == \'jpg\' || $ext == \'png\')){\n			unset($form-&gt;files[\'file\'.$i]);\n			$error =  \'Only JPEG, PNG and GIF files are allowed\';\n			$form-&gt;submitter = 0;\n		}\n	 }\n }\n\n$form-&gt;doAfterSubmitAction();\n\n if($error != \'\'){\n 	$form-&gt;error = $error;\n 	$form-&gt;page = 0;\n }\n\n$form-&gt;renderForm();\n\necho $form-&gt;page_html;\n  </globalphp>\n  <globaljs>\n    /*******************************************************************/\n// SmartFormer Gold © Form JS controller\n//\n// Product of IToris © 2009 http://www.itoris.com\n//\n/*******************************************************************/\n\nfunction formSubmit(submitter) {\n	//getting list of elements\n	var nodes = document.getElementById(\'sfg_fieldset\').childNodes;\n	var objects = Array();\n	for (var i=0; i&lt;nodes.length; i++) if (nodes[i].tagName) objects[objects.length] = nodes[i];\n	// perform validation\n	var isFormValid = true;\n	for (var vl=0; vl&lt;sfg_validation.length; vl++) if (window[\'validator\'+sfg_validation[vl][1]] &amp;&amp; objects[sfg_validation[vl][0]]) {\n		var msg = window[\'validator\'+sfg_validation[vl][1]](objects[sfg_validation[vl][0]], sfg_validation[vl][2], sfg_validation[vl][3] ? sfg_validation[vl][3] : \'\');\n		if (msg) {\n			isFormValid = false;\n			alert(msg);\n			objects[sfg_validation[vl][0]].focus();\n			return;\n		}\n	}\n	document.getElementById(\'sfg_submitter\').value = submitter;\n	document.sfgForm.submit();\n}\n\n\n\nfunction addAnotherFile(){\n   if (window.last_showed_upload_file_element){\n      var next_id = window.last_showed_upload_file_element + 1;}\n   else{\n      var next_id = 2;   \n   }      \n   var elem = document.getElementsByName(\'file\' + next_id)[0];\n   if (elem){\n      elem.style.visibility = \'visible\';\n      window.last_showed_upload_file_element = next_id;\n      var button = document.getElementsByName(\'add_another_file\')[0];\n      if (button){\n      	if(next_id &gt; 2){\n      		button.style.display = \'none\';\n      	}\n       var top = button.style.top.replace(\'px\', \'\');\n       var offset = elem.style.height.replace(\'px\',\'\');\n       var test  = parseInt(top) + parseInt(offset) + \'px\';\n       button.style.top = parseInt(top) + parseInt(offset) + \'px\';\n      }\n   }\n}\n  </globaljs>\n  <globalhtml>\n    &lt;!-- SmartFormer Gold code part --&gt;\n\n&lt;form action=\"\" method=\"post\" name=\"sfgForm\" enctype=\"multipart/form-data\"&gt;\n\n&lt;%form_html%&gt;\n\n&lt;/form&gt;\n\n&lt;!-- End of SmartFormer Gold code part --&gt;\n  </globalhtml>\n  <globalcss>\n    #sfg_err_message {\n	font-family: Arial;\n	font-size: 12px;\n	font-weight: bold;\n	color: #ff0000;\n}\n  </globalcss>\n  <page name=\"Page 1\" id=\"0\" />\n  <page name=\"Page 2\" id=\"1\" />\n  <page name=\"Page 3\" id=\"2\" />\n  <page name=\"Page 4\" id=\"3\" />\n  <page name=\"Page 5\" id=\"4\" />\n  <page name=\"Page 6\" id=\"5\" />\n  <page name=\"Page 7\" id=\"6\" />\n  <page name=\"Page 8\" id=\"7\" />\n  <page name=\"Page 9\" id=\"8\" />\n  <page name=\"Page 10\" id=\"9\" />\n  <element sfgalias=\"\" tag=\"div\" page=\"0\">\n    <style name=\"left\" value=\"0px\" />\n    <style name=\"top\" value=\"22px\" />\n    <style name=\"width\" value=\"460px\" />\n    <style name=\"height\" value=\"475px\" />\n    <style name=\"border\" value=\"1px solid #465b5d\" />\n    <style name=\"behavior\" value=\"\" />\n    <style name=\"background-image\" value=\"url({live_site}/skin/frontend/default/default/images/bkg_main2.gif)\" />\n    <style name=\"zoom\" value=\"\" />\n    <style name=\"z-index\" value=\"\" />\n    <style name=\"background-repeat\" value=\"no-repeat\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Contact Form\n    </content>\n    <style name=\"left\" value=\"0px\" />\n    <style name=\"top\" value=\"0px\" />\n    <style name=\"font-family\" value=\"Arial\" />\n    <style name=\"font-size\" value=\"14px\" />\n    <style name=\"color\" value=\"white\" />\n    <style name=\"background-color\" value=\"#243d4b\" />\n    <style name=\"height\" value=\"20px\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"padding-left\" value=\"8px\" />\n    <style name=\"line-height\" value=\"20px\" />\n    <style name=\"bottom\" value=\"\" />\n    <style name=\"border-width\" value=\"1px\" />\n    <style name=\"border-style\" value=\"solid\" />\n    <style name=\"border-bottom-style\" value=\"\" />\n    <style name=\"border-bottom-color\" value=\"\" />\n    <style name=\"border-color\" value=\"#465b5d\" />\n    <style name=\"border-bottom-width\" value=\"\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      You are a &lt;span style=\"color:red;\"&gt;*&lt;/span&gt;\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"41px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Supplier\n    </content>\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"34px\" />\n    <style name=\"border-width\" value=\"\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Vendor\n    </content>\n    <style name=\"left\" value=\"171px\" />\n    <style name=\"top\" value=\"34px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"You are a\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"radio\" />\n    <attribute name=\"name\" value=\"merchant\" />\n    <attribute name=\"value\" value=\"vendor\" />\n    <style name=\"left\" value=\"131px\" />\n    <style name=\"top\" value=\"52px\" />\n    <param name=\"group-required\" value=\"true\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"radio\" />\n    <attribute name=\"name\" value=\"merchant\" />\n    <style name=\"left\" value=\"181px\" />\n    <style name=\"top\" value=\"52px\" />\n    <style name=\"height\" value=\"14px\" />\n    <param name=\"group-required\" value=\"true\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      First Name: &lt;span style=\"color:red;\"&gt;*&lt;/span&gt;\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"75px\" />\n    <style name=\"border-width\" value=\"\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Last Name:\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"99px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      E-mail address: &lt;span style=\"color:red;\"&gt;*&lt;/span&gt;\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"123px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Phone:\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"147px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"First Name\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"text\" />\n    <attribute name=\"name\" value=\"first_name\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"75px\" />\n    <param name=\"required\" value=\"true\" />\n  </element>\n  <element sfgalias=\"Last Name\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"text\" />\n    <attribute name=\"name\" value=\"last_name\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"99px\" />\n  </element>\n  <element sfgalias=\"E-mail address\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"text\" />\n    <attribute name=\"name\" value=\"email\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"123px\" />\n    <param name=\"required\" value=\"true\" />\n    <param name=\"validation\" value=\"Email\" />\n  </element>\n  <element sfgalias=\"Phone\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"text\" />\n    <attribute name=\"value\" value=\"\" />\n    <attribute name=\"name\" value=\"phone\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"147px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Subject\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"171px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"Subject\" tag=\"select\" page=\"0\">\n    <content>\n      0|-- Please select a subject--\n1|Item 1\n2|Item 2\n3|Item 3\n    </content>\n    <attribute name=\"name\" value=\"subject\" />\n    <style name=\"width\" value=\"238px\" />\n    <style name=\"height\" value=\"21px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"171px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Message &lt;span style=\"color:red;\"&gt;*&lt;/span&gt;\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"196px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"Message\" tag=\"textarea\" page=\"0\">\n    <attribute name=\"rows\" value=\"5\" />\n    <attribute name=\"cols\" value=\"30\" />\n    <attribute name=\"name\" value=\"message\" />\n    <style name=\"width\" value=\"232px\" />\n    <style name=\"height\" value=\"121px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"196px\" />\n    <param name=\"required\" value=\"true\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Upload file\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"345px\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"file\" />\n    <attribute name=\"size\" value=\"30\" />\n    <attribute name=\"name\" value=\"file1\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"height\" value=\"21px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"342px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Protection Code:&lt;span style=\"color:#ff0000;\"&gt;*&lt;/span&gt;\n    </content>\n    <style name=\"left\" value=\"15px\" />\n    <style name=\"top\" value=\"425px\" />\n    <style name=\"font-weight\" value=\"\" />\n    <style name=\"color\" value=\"#465b5d\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Please, enter the text shown in the image into the field below.\n    </content>\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"410px\" />\n    <style name=\"font-size\" value=\"9px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"text\" />\n    <attribute name=\"name\" value=\"captcha_field\" />\n    <style name=\"width\" value=\"180px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"425px\" />\n    <param name=\"required\" value=\"true\" />\n  </element>\n  <element sfgalias=\"\" tag=\"img\" page=\"0\">\n    <attribute name=\"src\" value=\"{captcha0}\" />\n    <attribute name=\"alt\" value=\"captcha code\" />\n    <attribute name=\"name\" value=\"captcha_image\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"446px\" />\n    <param name=\"captcha-type\" value=\"0\" />\n    <param name=\"captcha-length\" value=\"6\" />\n    <param name=\"captcha-symbols\" value=\"abcsefghijklmnopqrstuvwxyz023456789\" />\n    <param name=\"captcha-field\" value=\"captcha_field\" />\n  </element>\n  <element sfgalias=\"\" tag=\"img\" page=\"0\">\n    <attribute name=\"src\" value=\"{live_site}/skin/adminhtml/default/default/itoris_sfg/jsf/images/reload.gif\" />\n    <attribute name=\"alt\" value=\"reload\" />\n    <attribute name=\"title\" value=\"Reload Captcha\" />\n    <style name=\"left\" value=\"274px\" />\n    <style name=\"top\" value=\"454px\" />\n    <style name=\"width\" value=\"16px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"cursor\" value=\"pointer\" />\n    <event name=\"onclick\" value=\"captchaReload(this, \'captcha_image\')\" />\n    <param name=\"on-click-action\" value=\"4\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"button\" />\n    <attribute name=\"value\" value=\"SEND\" />\n    <style name=\"width\" value=\"76px\" />\n    <style name=\"left\" value=\"386px\" />\n    <style name=\"top\" value=\"502px\" />\n    <style name=\"height\" value=\"20px\" />\n    <param name=\"on-click-action\" value=\"1\" />\n    <param name=\"save-data\" value=\"true\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"text\" />\n    <attribute name=\"name\" value=\"date\" />\n    <attribute name=\"value\" value=\"dsfsds2342\" />\n    <attribute name=\"readonly\" value=\"true\" />\n    <style name=\"width\" value=\"150px\" />\n    <style name=\"height\" value=\"16px\" />\n    <style name=\"left\" value=\"308px\" />\n    <style name=\"top\" value=\"0px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"button\" />\n    <attribute name=\"value\" value=\"Add another file\" />\n    <attribute name=\"name\" value=\"add_another_file\" />\n    <style name=\"width\" value=\"92px\" />\n    <style name=\"left\" value=\"369px\" />\n    <style name=\"top\" value=\"342px\" />\n    <style name=\"font-size\" value=\"11px\" />\n    <event name=\"onclick\" value=\"addAnotherFile();\" />\n    <param name=\"on-click-action\" value=\"0\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Only JPEG, PNG and GIF files are allowed\n    </content>\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"327px\" />\n    <style name=\"font-size\" value=\"9px\" />\n    <style name=\"width\" value=\"214px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"file\" />\n    <attribute name=\"size\" value=\"30\" />\n    <attribute name=\"name\" value=\"file2\" />\n    <style name=\"width\" value=\"180px\" />\n    <style name=\"height\" value=\"21px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"363px\" />\n    <style name=\"visibility\" value=\" hidden\" />\n  </element>\n  <element sfgalias=\"\" tag=\"input\" page=\"0\">\n    <attribute name=\"type\" value=\"file\" />\n    <attribute name=\"size\" value=\"30\" />\n    <attribute name=\"name\" value=\"file3\" />\n    <style name=\"width\" value=\"180px\" />\n    <style name=\"height\" value=\"21px\" />\n    <style name=\"left\" value=\"119px\" />\n    <style name=\"top\" value=\"384px\" />\n    <style name=\"visibility\" value=\" hidden\" />\n    <style name=\"unicode-bidi\" value=\"\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"1\">\n    <content>\n      Thank You for contating us!\n    </content>\n    <style name=\"left\" value=\"22px\" />\n    <style name=\"top\" value=\"21px\" />\n    <style name=\"font-size\" value=\"14px\" />\n    <style name=\"font-weight\" value=\"bold\" />\n    <style name=\"width\" value=\"209px\" />\n  </element>\n  <element sfgalias=\"\" tag=\"span\" page=\"0\">\n    <content>\n      Today\'s date\n    </content>\n    <style name=\"left\" value=\"235px\" />\n    <style name=\"top\" value=\"1px\" />\n  </element>\n  <email_template name=\"email to user\" from_name=\"admin of website\" from_email=\"admin@website.com\" subject=\"Your details on website.com\" cc=\"\" bcc=\"\" id=\"1\" format=\"1\">\n    &lt;p&gt;Dear user! &lt;br /&gt;Thank you for using our services on mysite.com. &lt;br /&gt;Your details are the following:&lt;/p&gt;\n&lt;p&gt;\n&lt;table border=\"0\"&gt;\n&lt;tbody&gt;\n&lt;tr&gt;\n&lt;td&gt;&lt;strong&gt;Field name&lt;/strong&gt;&lt;/td&gt;\n&lt;td&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;Field 1&lt;/td&gt;\n&lt;td&gt;Here you should insert dynamic variable&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;Field 2&lt;br /&gt;&lt;/td&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;Field 3&lt;br /&gt;&lt;/td&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;/tbody&gt;\n&lt;/table&gt;\n&lt;br /&gt;&lt;em&gt;P.S. Please do not answer on this e-mail. It has been generated automatically. &lt;/em&gt;&lt;/p&gt;\n  </email_template>\n  <email_template name=\"email to admin\" from_name=\"admin of website\" from_email=\"admin@website.com\" subject=\"New user details\" cc=\"\" bcc=\"\" id=\"2\" format=\"1\">\n    &lt;p&gt;Dear admin!&lt;br /&gt; New user has left his details on mysite.som &lt;br /&gt;The details are the folowing: :&lt;/p&gt;\n&lt;p&gt;\n&lt;table border=\"0\"&gt;\n&lt;tbody&gt;\n&lt;tr&gt;\n&lt;td&gt;&lt;strong&gt;Field name&lt;/strong&gt;&lt;/td&gt;\n&lt;td&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;Field 1&lt;/td&gt;\n&lt;td&gt;Here you should insert dynamic variable&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;Field 2&lt;br /&gt;&lt;/td&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;Field 3&lt;br /&gt;&lt;/td&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;/tbody&gt;\n&lt;/table&gt;\n&lt;/p&gt;\n  </email_template>\n  <email_template name=\"your custom email\" from_name=\"From Name\" from_email=\"from@email.com\" subject=\"Custom email subject\" cc=\"\" bcc=\"\" id=\"3\" format=\"1\">\n    &lt;p&gt;Fill in your custom email. You can create as meny templates as you wish. Click \'New Document\' icon to start&lt;/p&gt;\n  </email_template>\n  <validator name=\"Required\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Field is required\';\nmsg = msg.replace(\'%s\', sfgName); \nif (obj.type &amp;&amp; (obj.type.toLowerCase()==\'checkbox\' || obj.type.toLowerCase()==\'radio\') &amp;&amp; !obj.checked) return msg; \nif (obj.tagName.toLowerCase()==\'select\' &amp;&amp; (obj.selectedIndex==-1 || obj.selectedIndex==0)) return msg; \nif (obj.value==\'\') return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Field is required\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (!isset($form-&gt;data[$htmlName]) || !is_array($form-&gt;data[$htmlName]) &amp;&amp; trim($form-&gt;data[$htmlName])==\'\') return $msg;\nif (is_array($form-&gt;data[$htmlName]) &amp;&amp; trim(implode(\'\',$form-&gt;data[$htmlName]))==\'\') return $msg;\n    </php>\n  </validator>\n  <validator name=\"Group Required\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Group: %s. Please select a value\';\nmsg = msg.replace(\'%s\', sfgName); \nvar objs = document.getElementsByName(obj.name); \nvar checked = false; \nfor (i=0; i&lt;objs.length; i++) if (objs[i].checked) { checked = true; break; } \nif (!checked) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Group: \'.$obj[\'sfgalias\'].\'. Please select a value\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (!isset($form-&gt;data[$htmlName]) || !is_array($form-&gt;data[$htmlName]) &amp;&amp; trim($form-&gt;data[$htmlName])==\'\') return $msg;\nif (is_array($form-&gt;data[$htmlName]) &amp;&amp; trim(implode(\'\',$form-&gt;data[$htmlName]))==\'\') return $msg;\n    </php>\n  </validator>\n  <validator name=\"Check identical\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object, obj2 - another HTML element for comparing\nvar msg = \'Field: %s. Entities are not identival\';\nmsg = msg.replace(\'%s\', sfgName);\nvar el2 = document.getElementsByName(obj2)[0];\nif (el2 &amp;&amp; obj.value != el2.value) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation, $obj - another element\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Entities are not identival\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$htmlName2 = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $obj2);\n$htmlName2 = strtolower($htmlName2);\nif ($form-&gt;data[$htmlName]!=$form-&gt;data[$htmlName2]) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Email\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid email. Please specify a valid value\';\nmsg = msg.replace(\'%s\', sfgName);\nvar RegExp=/^((([a-z]|[0-9]|!|#|$|%|&amp;|\'|\\*|\\+|\\-|\\/|=|\\?|\\^|_|`|\\{|\\||\\}|~)+(\\.([a-z]|[0-9]|!|#|$|%|&amp;|\'|\\*|\\+|\\-|\\/|=|\\?|\\^|_|`|\\{|\\||\\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\\-){0,61}([a-z]|[0-9])\\.))*([a-z]|[0-9])([a-z]|[0-9]|\\-){0,61}([a-z]|[0-9])\\.)[\\w]{2,4}|(((([0-9]){1,3}\\.){3}([0-9]){1,3}))|(\\[((([0-9]){1,3}\\.){3}([0-9]){1,3})\\])))$/;\nif (obj.value!=\'\' &amp;&amp; !RegExp.test(obj.value.toLowerCase())) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid email. Please specify a valid value\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$RegExp=\"/^((([a-z]|[0-9]|!|#|$|%|&amp;|\'|\\*|\\+|\\-|\\/|=|\\?|\\^|_|`|\\{|\\||\\}|~)+(\\.([a-z]|[0-9]|!|#|$|%|&amp;|\'|\\*|\\+|\\-|\\/|=|\\?|\\^|_|`|\\{|\\||\\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\\-){0,61}([a-z]|[0-9])\\.))*([a-z]|[0-9])([a-z]|[0-9]|\\-){0,61}([a-z]|[0-9])\\.)[\\w]{2,4}|(((([0-9]){1,3}\\.){3}([0-9]){1,3}))|(\\[((([0-9]){1,3}\\.){3}([0-9]){1,3})\\])))$/\";\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; !preg_match($RegExp, strtolower($form-&gt;data[$htmlName]))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Zip\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify a correct zip/postal\';\nmsg = msg.replace(\'%s\', sfgName);\nvar letters=\'qwertyuiopasdfghjklzxcvbnm -1234567890\';\nvar ps=false;\nfor(i=0;i&lt;obj.value.length;i++) if (letters.indexOf(obj.value.toLowerCase().substr(i,1))&lt;0) ps=true;\nif (ps || obj.value.length&gt;10) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify a correct zip/postal\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$letters = \'qwertyuiopasdfghjklzxcvbnm -1234567890\';\nif (isset($form-&gt;data[$htmlName])) $value = strtolower($form-&gt;data[$htmlName]); else $value=\'\';\nfor($i=0; $i&lt;strlen($value); $i++) if (strpos($letters, substr($value, $i, 1))===false) return $msg;\n    </php>\n  </validator>\n  <validator name=\"ZipUS\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid US Zip. Please specify a valid value\';\nmsg = msg.replace(\'%s\', sfgName);\nvar zipPattern1=/^(\\d{5})$/;\nvar zipPattern2=/^(\\d{5})\\-(\\d{4})$/;\nif ((obj.value.match(zipPattern1)==null)&amp;&amp;(obj.value.match(zipPattern2)==null)&amp;&amp;obj.value.length&gt;0) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid US Zip. Please specify a valid value\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$zipPattern1=\"/^(\\d{5})$/\";\n$zipPattern2=\"/^(\\d{5})\\-(\\d{4})$/\";\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; !preg_match($zipPattern1, $form-&gt;data[$htmlName]) &amp;&amp; !preg_match($zipPattern2, $form-&gt;data[$htmlName])) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Phone\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify a correct phone number\';\nmsg = msg.replace(\'%s\', sfgName);\nvar letters=\'1234567890 -.()+\';\nvar ps=false;\nfor(i=0;i&lt;obj.value.length;i++) if (letters.indexOf(obj.value.toLowerCase().substr(i,1))&lt;0) ps=true;\nif (ps || obj.value.length&gt;10) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify a correct phone number\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$letters = \'1234567890 -.()+\';\nif (isset($form-&gt;data[$htmlName])) $value = strtolower($form-&gt;data[$htmlName]); else $value=\'\';\nfor($i=0; $i&lt;strlen($value); $i++) if (strpos($letters, substr($value, $i, 1))===false) return $msg;\n    </php>\n  </validator>\n  <validator name=\"PhoneUS\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid value! Please, provide a phone number in format XXX-XXX-XXXX, where X is a digit.\';\nmsg = msg.replace(\'%s\', sfgName);\nvar phonePattern=/^(\\d{3})\\-(\\d{3})\\-(\\d{4})$/;\nif ((obj.value.match(phonePattern)==null)&amp;&amp;obj.value.length&gt;0) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid value! Please, provide a phone number in format XXX-XXX-XXXX, where X is a digit.\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$phonePattern=\"/^(\\d{3})\\-(\\d{3})\\-(\\d{4})$/\";\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; !preg_match($phonePattern, strtolower($form-&gt;data[$htmlName]))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Password\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. The password should contain 6 to 12 symbols\';\nmsg = msg.replace(\'%s\', sfgName);\nif ((obj.value.length&lt;6 || obj.value.length&gt;12) &amp;&amp; obj.value.length!=0) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. The password should contain 6 to 12 symbols\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (strlen($form-&gt;data[$htmlName])&lt;6 || strlen($form-&gt;data[$htmlName])&gt;12)) return $msg;\n    </php>\n  </validator>\n  <validator name=\"CreditCardNumber\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify a correct credit card number\';\nmsg = msg.replace(\'%s\', sfgName);\nvar ccPattern=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$/;\nif ((obj.value.match(ccPattern)==null)&amp;&amp;obj.value.length&gt;0) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify a correct credit card number\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$ccPattern=\"/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$/\";\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; !preg_match($ccPattern, strtolower($form-&gt;data[$htmlName]))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"CreditCardCVV\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify a correct credit card CVV\';\nmsg = msg.replace(\'%s\', sfgName);\nvar letters=\'1234567890\';\nvar ps=false;\nfor(i=0;i&lt;obj.value.length;i++) if (letters.indexOf(obj.value.toLowerCase().substr(i,1))&lt;0) ps=true;\nif (ps || (obj.value.length&lt;3 &amp;&amp; obj.value.length!=0) || obj.value.length&gt;4) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify a correct credit card CVV\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (strlen($form-&gt;data[$htmlName])&lt;3 || strlen($form-&gt;data[$htmlName])&gt;4 || !is_numeric($form-&gt;data[$htmlName]))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Money\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify currency correctly\';\nmsg = msg.replace(\'%s\', sfgName);\nvar letters=\'1234567890.\';\nvar ps=false; for(i=0;i&lt;obj.value.length;i++) if (letters.indexOf(obj.value.toLowerCase().substr(i,1))&lt;0) ps=true;\nif (ps || obj.value.length&gt;10 || Math.floor(obj.value*100)/100!=obj.value-0) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify currency correctly\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (floor(floatval($form-&gt;data[$htmlName])*100)/100!=floatval($form-&gt;data[$htmlName]) || !is_numeric($form-&gt;data[$htmlName]))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"URL\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify a valid URL\';\nmsg = msg.replace(\'%s\', sfgName);\nvar RegExp=/^(([\\w]+:)?\\/\\/)?(([\\d\\w]|%[a-fA-f\\d]{2,2})+(:([\\d\\w]|%[a-fA-f\\d]{2,2})+)?@)?([\\d\\w][-\\d\\w]{0,253}[\\d\\w]\\.)+[\\w]{2,4}(:[\\d]+)?(\\/([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)*(\\?(&amp;?([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})=?)*)?(#([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)?$/;\nif (obj.value!=\'\' &amp;&amp; !RegExp.test(obj.value)) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify a valid URL\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$RegExp=\"/^(([\\w]+:)?\\/\\/)?(([\\d\\w]|%[a-fA-f\\d]{2,2})+(:([\\d\\w]|%[a-fA-f\\d]{2,2})+)?@)?([\\d\\w][-\\d\\w]{0,253}[\\d\\w]\\.)+[\\w]{2,4}(:[\\d]+)?(\\/([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)*(\\?(&amp;?([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})=?)*)?(#([-+_~.\\d\\w]|%[a-fA-f\\d]{2,2})*)?$/\";\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; !preg_match($RegExp, strtolower($form-&gt;data[$htmlName]))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"IP\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Please specify a correct IP\';\nmsg = msg.replace(\'%s\', sfgName);\nvar RegExp=/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/;\nvar a=obj.value.split(\'.\');\nif (obj.value!=\'\' &amp;&amp; !RegExp.test(obj.value) || a[0]&gt;255 || a[1]&gt;255 || a[2]&gt;255 || a[3]&gt;255) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Please specify a correct IP\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$RegExp=\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\";\nif (isset($form-&gt;data[$htmlName])) $parts = explode(\'.\', $form-&gt;data[$htmlName]); else $parts = array(999,999,999,999);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (!preg_match($RegExp, $form-&gt;data[$htmlName]) || intval($parts[0])&gt;255 || intval($parts[1])&gt;255 || intval($parts[2])&gt;255 || intval($parts[3])&gt;255)) return $msg;\n    </php>\n  </validator>\n  <validator name=\"SSN\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid value! Please, provide a SSN in format XXX-XX-XXXX or XX-XXXXXXX, where X is a digit.\';\nmsg = msg.replace(\'%s\', sfgName);\nvar ssnPattern1 = /^(\\d{3})\\-(\\d{2})\\-(\\d{4})$/;\nvar ssnPattern2 = /^(\\d{2})\\-(\\d{7})$/;\nif ((obj.value.match(ssnPattern1)==null)&amp;&amp;(obj.value.match(ssnPattern2)==null)&amp;&amp;obj.value.length&gt;0) return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid value! Please, provide a SSN in format XXX-XX-XXXX or XX-XXXXXXX, where X is a digit.\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\n$ssnPattern1=\"/^(\\d{3})\\-(\\d{2})\\-(\\d{4})$/\";\n$ssnPattern2=\"/^(\\d{2})\\-(\\d{7})$/\";\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; !preg_match($ssnPattern1, $form-&gt;data[$htmlName]) &amp;&amp; !preg_match($ssnPattern2, $form-&gt;data[$htmlName])) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Date\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid value! Field value should be in MM/DD/YYYY format.\';\nmsg = msg.replace(\'%s\', sfgName);\nvar a=obj.value.split(\'/\');\nif (a[0]-0&gt;0 &amp;&amp; a[0]-0&lt;=12 &amp;&amp; a[1]-0&gt;0 &amp;&amp; a[1]-0&lt;=31 &amp;&amp; a[2]-0&gt;1000 &amp;&amp; a[2]-0&lt;=9999 &amp;&amp; a[3]==null ||obj.value.length==0) return null; else return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid value! Field value should be in MM/DD/YYYY format.\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (isset($form-&gt;data[$htmlName])) $parts=explode(\'/\', $form-&gt;data[$htmlName]); else $parts=array(0,0,0);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (count($parts)!=3 || !checkdate(intval($parts[0]), intval($parts[1]), intval($parts[2])))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"DateShort\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid value! Field value should be in MM/DD/YY format\';\nmsg = msg.replace(\'%s\', sfgName);\nvar a=obj.value.split(\'/\');\nif (a[0]-0&gt;0 &amp;&amp; a[0]-0&lt;=12 &amp;&amp; a[1]-0&gt;0 &amp;&amp; a[1]-0&lt;=31 &amp;&amp; a[2]-0&gt;=0 &amp;&amp; a[2]-0&lt;=99 &amp;&amp; a[3]==null ||obj.value.length==0) return null; else return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid value! Field value should be in MM/DD/YY format.\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (isset($form-&gt;data[$htmlName])) $parts=explode(\'/\', $form-&gt;data[$htmlName]); else $parts=array(0,0,0);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (count($parts)!=3 || !is_numeric($parts[2]) || !checkdate(intval($parts[0]), intval($parts[1]), intval($parts[2])+2000))) return $msg;\n    </php>\n  </validator>\n  <validator name=\"Time\">\n    <js>\n      // incoming variables: obj - HTML element firing the event, sfgName - system name of the object \nvar msg = \'Field: %s. Invalid value! Field value should be in HH:MM format.\';\nmsg = msg.replace(\'%s\', sfgName);\nvar a=obj.value.split(\':\');\nif (a[0]-0&gt;=0 &amp;&amp; a[0]-0&lt;24 &amp;&amp; a[1]-0&gt;=0 &amp;&amp; a[1]-0&lt;60 &amp;&amp; a[2]==null ||obj.value.length==0) return null; else return msg;\n    </js>\n    <php>\n      // incoming variables: $form - the form object, $obj - structured object of element firing the validation\n$msg = \'Field: \'.$obj[\'sfgalias\'].\'. Invalid value! Field value should be in HH:MM format.\';\n$htmlName = str_replace(array(\'[\', \']\', \' \'), array(\'\',\'\',\'\'), $form-&gt;getProp($obj[\'attributes\'], \'name\'));\n$htmlName = strtolower($htmlName);\nif (isset($form-&gt;data[$htmlName])) $parts=explode(\':\', $form-&gt;data[$htmlName]); else $parts=array(99,99);\nif (isset($form-&gt;data[$htmlName]) &amp;&amp; $form-&gt;data[$htmlName]!=\'\' &amp;&amp; !is_array($form-&gt;data[$htmlName]) &amp;&amp; (count($parts)!=2 || !is_numeric($parts[0]) || !is_numeric($parts[1]) || intval($parts[0])&lt;0 || intval($parts[0])&gt;23 || intval($parts[1])&lt;0 || intval($parts[1])&gt;59)) return $msg;\n    </php>\n  </validator>\n</form>\n',`params`=''; 
###sfg_dump_separator### 
create table if not exists `sfg_example_contactcustom` (`id` int(11) NOT NULL  auto_increment, `merchant` varchar(255) NOT NULL default '' , `first_name` varchar(255) NOT NULL default '' , `last_name` varchar(255) NOT NULL default '' , `email` varchar(255) NOT NULL default '' , `phone` varchar(255) NOT NULL default '' , `subject` varchar(255) NOT NULL default '' , `message` text NOT NULL default '' , `file1` varchar(255) NOT NULL default '' , `date` varchar(255) NOT NULL default '' , `file2` varchar(255) NOT NULL default '' , `file3` varchar(255) NOT NULL default '' ,  PRIMARY KEY (id)); 
