Welcome Guest, Not a member yet? Register   Sign In
Using jquery for form validation in codeigniter
#3

[eluser]esenes[/eluser]
ya i explain my problem

My directory structure as follows

---CI2
------application
------system
------userguide
------js //here jquery files stored
---------jquery-latest.js
---------jquery.validate.js

My View Code

display.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
&lt;html &gt;

&lt;head&gt;
&lt;title&gt;CodeIgniter Test&lt;/title&gt;


[removed][removed]
[removed][removed]


&lt;style type="text/css"&gt;
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
&lt;/style&gt;

[removed]
$(document).ready(function(){
$("#commentForm").validate();
});
[removed]

&lt;/head&gt;
&lt;body &gt;

&lt;form class="cmxform" id="commentForm" method="post" action="#"&gt;
<label>name
&lt;input type="text" name="name" id="name" class="required" /&gt;
</label>
<p>
<label>age
&lt;input type="text" name="age" id="age" class="required" /&gt;
</label>
</p>
<p>
<label>
&lt;input type="submit" name="button" id="button" value="Submit" /&gt;
</label>
</p>
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;

My Controller

message.php

&lt;?php
// message.php

class message extends CI_Controller
{
function __construct()
{
parent::__construct();
}

function index() {


$this->load->view('display');
}


}
?&gt;


i imported two file in head section jquery-latest.js and jquer,validate.js


Messages In This Thread
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 12:54 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 02:50 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 03:38 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 04:23 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 05:01 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 05:06 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 05:09 AM
Using jquery for form validation in codeigniter - by El Forum - 03-15-2011, 05:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB