我是jquery和codeigniter的新手,但沒有編程我已經使用javascript做了一些驗證。 我想在我的項目中使用jQuery和驗證表單輸入plz幫助我一步一步如何在代碼點火器中包含jquery
。如何包含jquery?
。如何使用它來驗證表單?
<!DOCTYPE html>
<html>
<head>
<title><?php echo $title; ?></title>
</head>
<body>
<form id="form" action="<?php echo $form_action; ?>" method="post">
<center><h1><?php echo $form_h1; ?></h1></center>
<table width="800" border="1" bordercolor="BLUE" align="center" cellpadding="5" cellspacing="2">
</tr>
<tr>
<td>
<b>FirstName</b>
</td>
<td>
<input type="text" id="firstname" name="firstname">
<span class="firstname_error_msg" style="color: #ff0000;"></span>
</td>
</tr>
<tr>
<td>
<b>LastName</b>
</td>
<td>
<input type="text" id="lastname" name="lastname">
</td>
</tr>
<tr> You can <em>not</em> use Markdown in here.
<td>
<b>Address</b>
</td>
<td>
<input type="text" id="address" name="address" />
<span class="address_error_msg" style="color: #ff0000;"></span>
</td>
</tr>
<tr>
<td>
<b>Email Id</b>
</td>
<td>
<input type="text" id="email" name="email"/>
<span class="email_error_msg" style="color: #ff0000;"></span>
</td>
</tr>
<tr>
<td>
<b>Password</b>
</td>
<td>
<input type="text" id="password" name="password" />
<span class="password_error_msg" style="color: #ff0000;"></span>
</td>
</tr> You can <em>not</em> use Markdown in here.
<tr>
<td>
<b>Gender</b>
</td>
<td>
<select name="gender">
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</td>
</tr>
<tr>
<td>
<b>Date Of Birth</b>
</td>
<td>
<input type="text" id="dob" name="dob" />
</td>
</tr>
<tr>
<td>
<b>Age</b>
</td>
<td>
<input type="text" name="age" />
</td>
</tr>
<tr>
<td>
<b>Zipcode</b>
</td>
<td>
<input type="text" id="zipcode" name="zipcode"/>
<span class="zipcode_error_msg" style="color: #ff0000;"></span>
</td>
</tr>
<tr>
<td>
<b>Mobile</b>
</td>
<td>
<input type="text" name="mobile"/>
</td>
</tr>
<tr>
<td colspan="100%" align="center" >
<input type="submit" id="submit" name="submit" value="Submit"/>
<input id="reset" type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
你會發現所有你的Javascript CI圖書館Integeration文檔中的需要:'ellislab.com /笨/用戶指南/庫/ javascript.html' –