Showing posts with label JQUERY. Show all posts
Showing posts with label JQUERY. Show all posts

Validations In asp.net With Text focus Using Jquery

Step1:- Validations on jquery
$(document).ready(function () {
            $("#btnSave").click(function () {
                var firstName = $("#txtFirstName").val();
                var lastName = $("#txtLastName").val();
                var Email = $("#txtEmail").val();
                var password = $("#txtPassword").val();
                var confirmPassword = $("#txtConfirmPassword").val();
                var Gender = $("#ddlGender option:selected").text();
                if (firstName == "" && lastName == "" && Email == "" && password == "" &&        confirmPassword == "" && Gender == "Select Gender")
                {
                    $("#txtFirstName").css("border-color", "red");
                    $("#txtLastName").css("border-color", "red");
                    $("#txtEmail").css("border-color", "red");
                    $("#txtPassword").css("border-color", "red");
                    $("#txtConfirmPassword").css("border-color", "red");
                    $("#ddlGender").css("border-color", "red");
                    return false;
                }
            });
        });

Validations In ASP.NET Using Jquery

STEP1:- Jquery validations using button click
<script src="Scripts/jquery-3.1.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnSave").click(function () {
                var firstName = $("#txtFirstName").val();
                var lastName = $("#txtLastName").val();
                var Email = $("#txtEmail").val();
                var password = $("#txtPassword").val();
                var confirmPassword = $("#txtConfirmPassword").val();
                var Gender = $("#ddlGender option:selected").text();
                if (firstName == "") {
                    alert("First Name Required");
                }
                else if (lastName == "") {
                    alert("Last Name Required");
                }
                else if (Email == "") {
                    alert("Email Required");
                }
                else if (password == "") {
                    alert("Password Required");
                }
                else if (confirmPassword == "") {
                    alert("Confirm Password Required");
                }
                else if (Gender == "Select Gender") {
                    alert("Gender Required");
                }
            });
        });
    </script>

How To Get TextBox Value Using Button Click In Jquery

In this article i explain you how to get textbox value in jquery
Add jquery refereces to your code
Step1:-
 <script type="text/javascript">
        $(document).ready(function () {  

Datepicker In Jquery

In this article i explain you how to use datepicker
Below are some of the datepicker options and methos listed
Options:-                                             Methos:-
maxDate                                              destroy

minDate                                               dialog
dateFormat                                          getDate
buttonImage                                         hide
buttonImageOnly                                 isDisabled
buttonText               

Jquery Accordion Customization Example

In this article i explain you how to customize the jquery accordion
Download the jquery scripts in jquery.com
use jquery ui-widge in your code

Dont get confuse it is very simple believe me just it looking lenthy thats not a matter copy the step3 code and paste in your source code
STEP 1:- Write script code
 <script type="text/javascript">