<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Form validation Archives - Postnidea</title>
	<atom:link href="https://www.postnidea.com/tag/form-validation/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.postnidea.com/tag/form-validation/</link>
	<description>Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos</description>
	<lastBuildDate>Thu, 24 Oct 2024 10:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.8</generator>

<image>
	<url>https://www.postnidea.com/wp-content/uploads/2019/08/favicon.ico</url>
	<title>Form validation Archives - Postnidea</title>
	<link>https://www.postnidea.com/tag/form-validation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>jquery form validation using php with mysql database</title>
		<link>https://www.postnidea.com/jquery-form-validation-using-php-with-mysql-database/</link>
					<comments>https://www.postnidea.com/jquery-form-validation-using-php-with-mysql-database/#respond</comments>
		
		<dc:creator><![CDATA[Rakesh Kumar]]></dc:creator>
		<pubDate>Mon, 16 Jan 2017 17:45:00 +0000</pubDate>
				<category><![CDATA[dynamic form validation]]></category>
		<category><![CDATA[form validation]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[validation library]]></category>
		<category><![CDATA[Form validation]]></category>
		<category><![CDATA[Jquery form validation]]></category>
		<category><![CDATA[mysql database validation]]></category>
		<category><![CDATA[php server side validation]]></category>
		<guid isPermaLink="false"></guid>

					<description><![CDATA[<p>Nowadays jquery or Javascript is more prominent. Every client wants their application to become faster &#38; user interactive so they [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/jquery-form-validation-using-php-with-mysql-database/">jquery form validation using php with mysql database</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;">
<p style="text-align: justify;">Nowadays jquery or Javascript is more prominent. Every client wants their application to become faster &amp; user interactive so they good user experience, get more customer. Whenever you complete our functionality with ajax request that makes attractiveness because user stays on the same page he sees there task also complete only dom element manipulation occurring. So I figure one common functionality required everywhere which form validation. Without form validation, you can not be complete our functionality of our requirement.</p>
<p style="text-align: justify;">A few days ago I was written a PHP class that deal with validation you can review by click on that link <a title="PHP class for form validation" href="http://postnidea.com/php-class-form-validation/">Click</a>. So in this validation, i write methods of different validation like blank, number, email, validation of field from database like a username. When you review code <a title="PHP class for form validation" href="http://postnidea.com/php-class-form-validation/">Click</a> you will find there is no ajax no form code only a PHP class which shows validation. So require a javascript class that can use for process our request.</p>
<h2>Implementation of jquery form validation using php with mysql database</h2>
<p style="text-align: justify;">Now we start to create a javascript class for processing form. For my javascript code, i have dependency with bootstrap which common CSS framework, with the usage of that framework you can complete our application with responsive design without any help of a designer.<br />
I write a small chunk of code a form which is below.</p>
<p><script src="https://gist.github.com/postnidea/5d8d29110513ca37bb2a604ec03ee4fa.js"></script></p>
<p style="text-align: justify;">In above code, form tag has two selectors like id, action both are required for the form processing. Action are required on which you form being processed. ID is required for pick values suppose if multiple forms then it will more helpful. Another is &#8220;Submit&#8221; button with their click event we fire a request &amp; process it. After processing it will return JSON format response on the basis of that we can manipulate the DOM elements. So we require a function when we click on the submit button it will perform required function. Now below I write a code.</p>
<p><script src="https://gist.github.com/postnidea/2ace7272561b0d54ddad8f4f732d4d3c.js"></script></p>
<p style="text-align: justify;">In above code &#8220;server_validation&#8221; its function for which need to pass the certain parameter on the basis of that it perform form processing. The parameter explanation is below</p>
<p>form_id:&#8217;add_form&#8217; // its the Id of form<br />
button_id:&#8217;add_button&#8217;, // its the Id button<br />
after_success:load_success // its the name of function that call after success of form.</p>
<p>With the help of above code you can just validate form but if you want any callback function then call below function</p>
<p><script src="https://gist.github.com/postnidea/56a36d3d831215a889015dc28a332055.js"></script></p>
<p style="text-align: justify;">In the above code, every thing is same only I added the &#8220;after_success&#8221; variable in which I pass the name of the function that needs to call after the success of form.</p>
<p><a class="btn btn-primary btn-blue" href="http://demo.postnidea.com/jquery-form-validation-using-php/" target="_blank" rel="noopener noreferrer">Demo</a> <a class="btn btn-primary btn-blue" href="https://github.com/postnidea/jquery-form-validation-using-php" target="_blank" rel="noopener noreferrer">code</a></p>
</div>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/jquery-form-validation-using-php-with-mysql-database/">jquery form validation using php with mysql database</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.postnidea.com/jquery-form-validation-using-php-with-mysql-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP class for form validation</title>
		<link>https://www.postnidea.com/php-class-for-form-validation/</link>
					<comments>https://www.postnidea.com/php-class-for-form-validation/#comments</comments>
		
		<dc:creator><![CDATA[Rakesh Kumar]]></dc:creator>
		<pubDate>Sun, 31 Jul 2016 13:50:00 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php class]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[Form validation]]></category>
		<category><![CDATA[php server side validation]]></category>
		<category><![CDATA[PHP validation class]]></category>
		<guid isPermaLink="false"></guid>

					<description><![CDATA[<p>PHP plays great role in the form values sensitization. PHP provide filters with the help of that you plays with [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/php-class-for-form-validation/">PHP class for form validation</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;">
<p>PHP plays great role in the form values sensitization. PHP provide filters with the help of that you plays with form validation &amp; sensitization of form values. PHP provides three types of filter which is below.</p>
<ul>
<li> Validate filters</li>
<li> Sanitize filters</li>
<li> Other filters</li>
</ul>
<p><b>Validate filters</b><br />
PHP provide in built function for some values validate like email, url, IP address, int , float &amp; regx validation.<br />
for more information</p>
<p><b>Sanitize filters</b><br />
Sanitize filters are used for making valid input so that in future it will create the hole in application. With maintian validation user can be input such a values that can break the functionlity like not inserted in the database or can input the code that can be used in the future. So Sanitize filters can be filter the user inputs.</p>
<p><b>Other filters </b><br />
PHP faciliate to developer he can be add our custom function. That function can be call at time of validation.</p>
<p>So with the usage of these function ii try to create  a class that can be used for validation form. The class that i have written in which covered the below validation.</p>
<ul>
<li>Email validation</li>
<li>Required validation</li>
<li>Numeric validation</li>
<li>positive numeric validation</li>
<li>positive integer validation</li>
<li>URL</li>
<li>Alpha</li>
<li>Alphanumeric</li>
<li>Unique value in database</li>
<li>two parameter field value comparison</li>
<li>Max &amp; Min character limit</li>
<li>Photos</li>
<li>upload validation</li>
</ul>
<h2>PHP Form validation Library</h2>
<p>So below i will show you structure of the class how to be processed. We cretae the seprate function each above validation. which is shown to you in below code.</p>
<p>You can get here code of <a class="btn btn-primary btn-blue" href="https://gist.github.com/rakeshkumar125/2673a98bccfd3a1e13c03b335d7d8f6a">PHP Form Validation Library</a></p>
<h2>Use of PHP Form validation Library</h2>
<p>Now show to how to be use this class. So, First need to initialize the Class with config array, from the config array it will get the data &amp; process it. For different validation how to call. In below code first need to initialize the array. Then provide the one dimensional array to validate for array variable [array_to_validate]. Here just need to pass the name of the element the class will process there values &amp; return the validation status. For example [$config[&#8217;email&#8217;]] assign account_email, alternative_email textbox name so that it can be validate.</p>
<p>Now let me show you with code.</p>
<pre><code>$config = array();
$config['array_to_validate'] = $_POST or array_need_to_validate;
$config['email'] 	     = "email,forgot_email";
$config['required']	     = "date_birth,phone,mobile";
$config['numeric']	     = "mobile";
$config['positive_numeric']  = "positive_number";
$config['positive_integer']  = "positive_integer";
$config['url']		     = "url";
$config['alpha']	     = "name";
$config['alphanumeric']	     = "user_password";
</code></pre>
<p>Now its some thing different because this validation the database. field_name means provide the textbox name or element that need to validation.</p>
<p>Implimentation of unique value in database like user name:</p>
<pre>$config['unique_from_table']= array(
				array(
				'field_name' =&gt;'',
				'table_name' =&gt;'user',
				'table_field'=&gt;'username'
				),
				array(
				'field_name' =&gt;'',
				'table_name' =&gt;'users',
				'table_field'=&gt;'username'
				)
			);
</pre>
<h2>Comparasion</h2>
<pre><code>
$config['compare']= array(
			array(
				'field_name' =&gt;'username',
				'compare_field_name' =&gt;'firstname',
			),
			array(
			  'field_name' =&gt;'lastname',
			  'compare_field_name' =&gt;'firstname'
			)
		);
</code></pre>
<h2>Character Limit Validation</h2>
<pre><code>
$config['min_character_limit']= array(
				    array(
					'field_name' =&gt;'username',
					'no_of_character' =&gt;'20',
				    ),
				    array(
					'field_name' =&gt;'lastname',
					'no_of_character' =&gt;'30'
				    )
				);

$config['max_character_limit'] = array(
								array(
									'field_name' =&gt;'username',
									'no_of_character' =&gt;'20',
								),
								array(
									'field_name' =&gt;'lastname',
									'no_of_character' =&gt;'30'
								)
							);

</code></pre>
<p>Finally call the class &amp; pass all things which we have built in above. Then class will process your inputs &amp; return the result. If there is validation error then return array of error otherwise pass it.</p>
<pre><code>
$my_validator = new validator($config)
$error = $my_validator-&gt;process_validation();
</code></pre>
</div>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/php-class-for-form-validation/">PHP class for form validation</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.postnidea.com/php-class-for-form-validation/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
