only one field fail to validate using jquery validation plugin
i have a form with some input fields , i want to make client side validation using jquery validation plugin, it works fine but only notification input filed doesnt show the error message when it is empty, i dont knw what's wrong . here is my code
my form input fields "> Adding new products '.$_SESSION['success'].''; unset($_SESSION['success']);} ?>
<div class="control-group">
<label class="control-label">Name</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-ban-circle"></i></span>
<input type="text" class="input-xlarge" id="name" name="name" placeholder="Name of the product"
value="<?php echo htmlspecialchars($name); ?>">
</div>
<span class="error"><?php echo $nameErr;?></span>
</div>
</div>
<div class="control-group ">
<label class="control-label">Category</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-pills"></i></span>
<input type="text" class="input-xlarge" id="category" name="category" placeholder="Computer,Tv, Phone etc"
value="<?php echo htmlspecialchars($category)?>">
</div>
<span class="error"><?php echo $categoryErr;?></span>
</div>
</div>
<div class="control-group">
<label class="control-label">Quantity</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-ban-circle"></i></span>
<input type="text" id="quantity" class="input-mini" name="quantity" placeholder="Quantity"
value="<?php echo htmlspecialchars($quantity);?>">
</div>
<select class="selectpicker remove-example" name="per" id="per" selected="true">
<?php if(isset($_POST['submit'])){ ?>
<option value="<?php echo $_POST['per']; ?>" selected="selected"><?php echo $_POST['per']; ?></option>
<?php }else{ ?>
<option value="">Choose amount</option>
<?php } ?>
<option value="" disabled="disabled"> -------------------- </option>
<option value="unit">unit</option>
<option value="dozen">dozen</option>
<option value="box">box</option>
</select>
<span class="error"><?php echo $quantityErr.$perErr;?></span>
</div>
</div>
<div class="control-group">
<label class="control-label">Buying Price</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-dollars"></i></span>
<input type="text" class="input-small" id="buying_price" name="buying_price" placeholder="Product Price"
value="<?php echo htmlspecialchars($buying_price); ?>"
i have a form with some input fields , i want to make client side validation using jquery validation plugin, it works fine but only notification input filed doesnt show the error message when it is empty, i dont knw what's wrong . here is my code
my form input fields "> Adding new products '.$_SESSION['success'].''; unset($_SESSION['success']);} ?>
<div class="control-group">
<label class="control-label">Name</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-ban-circle"></i></span>
<input type="text" class="input-xlarge" id="name" name="name" placeholder="Name of the product"
value="<?php echo htmlspecialchars($name); ?>">
</div>
<span class="error"><?php echo $nameErr;?></span>
</div>
</div>
<div class="control-group ">
<label class="control-label">Category</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-pills"></i></span>
<input type="text" class="input-xlarge" id="category" name="category" placeholder="Computer,Tv, Phone etc"
value="<?php echo htmlspecialchars($category)?>">
</div>
<span class="error"><?php echo $categoryErr;?></span>
</div>
</div>
<div class="control-group">
<label class="control-label">Quantity</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-ban-circle"></i></span>
<input type="text" id="quantity" class="input-mini" name="quantity" placeholder="Quantity"
value="<?php echo htmlspecialchars($quantity);?>">
</div>
<select class="selectpicker remove-example" name="per" id="per" selected="true">
<?php if(isset($_POST['submit'])){ ?>
<option value="<?php echo $_POST['per']; ?>" selected="selected"><?php echo $_POST['per']; ?></option>
<?php }else{ ?>
<option value="">Choose amount</option>
<?php } ?>
<option value="" disabled="disabled"> -------------------- </option>
<option value="unit">unit</option>
<option value="dozen">dozen</option>
<option value="box">box</option>
</select>
<span class="error"><?php echo $quantityErr.$perErr;?></span>
</div>
</div>
<div class="control-group">
<label class="control-label">Buying Price</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-dollars"></i></span>
<input type="text" class="input-small" id="buying_price" name="buying_price" placeholder="Product Price"
value="<?php echo htmlspecialchars($buying_price); ?>"
No comments:
Post a Comment