I'm using a Bootstrap template for my web app. Now in one form I'm accepting a US Zip code value from the user, submitting the form to the desired page and showing the result.
Now I have to put validations for it as follows:
- The value entered by user in input field "zip_code" should only be Valid US zip code. If he/she enters invalid value then the error message in red color should appear above the text field intended for entering zip code. The form should not get submit.
- This validation should be done by using jQuery and on clicking of a map-marker icon which I made to behave like a submit button.
Following is the necessary HTML code snippet :
<div class="nav-collapse">
<ul class="nav pull-right navbar-fixed-bottom">
<li><a href="#"><i class="icon-user icon-black"></i> LOGIN</a></li>
<li><a href="#"><i class="icon-pencil icon-black"></i> REGISTER</a></li>
<li><a href="#"><i class="icon-edit icon-black"></i> STATUS</a></li>
<li><a href="#"><i class="icon-envelope icon-black"></i> CONTACT</a></li>
<li><a href="#"><i class="icon-user icon-black"></i> MY ACCOUNT</a></li>
<li><a href="#"><i class="icon-user icon-black"></i> SHOP DESTINATOR</a></li>
<li>
<form action="abc.php" class="navbar-form pull-right" id="formzip" method="post">
<input style="width: 115px;" type="text" placeholder="Enter the zip code" name="zip_code" id="zip_code" value=""> <i class="icon-map-marker icon-black" onclick='$("#formzip").submit();'></i>
</form>
</li>
</ul>
</div><!--/.nav-collapse -->
As I'm a relatively new to the Bootstrap framework can someone please help me in this regard?
Thanks for spending some of your valuable time in understanding my issue. If you need any other information regarding my issue please do let me know. Any kind of help would be greatly appreciated.
Waiting for your precious replies.