Click here to Skip to main content
15,914,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: integrating Paypal into ASP.NET Pin
jkirkerx3-Apr-12 14:05
professionaljkirkerx3-Apr-12 14:05 
GeneralRe: integrating Paypal into ASP.NET Pin
Jassim Rahma3-Apr-12 20:27
Jassim Rahma3-Apr-12 20:27 
GeneralRe: integrating Paypal into ASP.NET Pin
jkirkerx4-Apr-12 5:54
professionaljkirkerx4-Apr-12 5:54 
GeneralRe: integrating Paypal into ASP.NET Pin
Jassim Rahma15-Sep-12 8:25
Jassim Rahma15-Sep-12 8:25 
QuestionASP.net click grid view edit twice issue Pin
thepitzaboy3-Apr-12 4:40
thepitzaboy3-Apr-12 4:40 
QuestionDelete row not working Pin
byka3-Apr-12 1:49
byka3-Apr-12 1:49 
GeneralRe: Delete row not working Pin
Not Active3-Apr-12 2:09
mentorNot Active3-Apr-12 2:09 
QuestionCalling jquery method from another jquery method Pin
indian1432-Apr-12 15:08
indian1432-Apr-12 15:08 
Hi,

I am new to jquery, I have following validation methods on my form. But if once I place an update panel of ajax on top of the main parent div tag in my form, these validation methods are not executing properly. I dont know the reason because I am new to the jquery.

Please help me either by giving some solution to this problem or help me how should I call these methods from my endrequest method of jquery.

Here is the jquery code

  <script type="text/javascript" src="../Script/Payment.js"></script>
  <script type="text/javascript" src="../Scripts/jquery.validate.creditcard2.js"></script>
  <script type="text/javascript">

      var lastNameValid = false;
      var confirmationValid = false;

  $(document).ready(function(){

      $(function ($) {
      $("#phonenumber").MaskPhoneNumber();
  });

          $(function ($) {
      $("#telephone").MaskPhoneNumber();
  });
                  $(function ($) {
      $("#postcode").ForceNumericOnly();
  });

                      $(function ($) {
      $("#cardnum").ForceNumericOnly();
  });

                          $(function ($) {
      $("#ccMonth").ForceNumericOnly();
  });

                              $(function ($) {
      $("#ccYear").ForceNumericOnly();
  });

                              $(function ($) {
      $("#securityCode").ForceNumericOnly();
  });


     $('.validationGroup .causesValidation').click(function (evt) {

  // Ascend from the button that triggered this click event
  //  until we find a container element flagged with
  //  .validationGroup and store a reference to that element.
  var $group = $(this).parents('.validationGroup');

  var isValid = true;

  // Descending from that .validationGroup element, find any input
  //  elements within it, iterate over them, and run validation on
  //  each of them.
  $group.find(':input').each(function (i, item) {

  if($(item)[0].id != "")
  {
    if (!$(item).valid())
    {
      isValid = false;
    }
  }
});

  if (!isValid)
    evt.preventDefault();
});


      $("#MainForm").validate({

          rules: {

              <%= firstname.UniqueID %>: {
                  required: true,
                  minlength: 1
              },
              <%= lastname.UniqueID %>: {
                  required: true,
                  minlength: 1
              },
               <%= phonenumber.UniqueID %>: {
                  required: true,
                  minlength: 12
              },
               <%= cardholdername.UniqueID %>: {
                  required: true,
                  minlength: 1
              },
               <%= address1.UniqueID %>: {
                  required: true,
                  minlength: 1
              },
               <%= city.UniqueID %>: {
                  required: true,
                  minlength: 1
              },
               <%= postcode.UniqueID %>: {
                  required: true,
                  minlength: 5,
                  number: true
              },
              <%= telephone.UniqueID %>: {
                  required: true,
                  minlength: 12
              },
               <%= ccMonth.UniqueID %>: {
                  required: true,
                  minlength: 2,
                  number: true
              },
               <%= ccYear.UniqueID %>: {
                  required: true,
                  minlength: 4,
                  number: true
              },
               <%= securityCode.UniqueID %>: {
                  required: true,
                  minlength: 3,
                  number: true
              },
              <%= rblPaymentType.UniqueID %>: {
                  required: true
              },
              <%= cardnum.UniqueID %>: {
              required: true,
              number: true
              }
          },
          messages: {

              <%= firstname.UniqueID %>: {
                  required: "Please provide your First Name",
                  minlength: "Your First Name must be at least 1 character"
              },
              <%= lastname.UniqueID %>: {
                  required: "Please provide your Last Name",
                  minlength: "Your Last Name must be at least 1 character"
              },
              <%= phonenumber.UniqueID %>: {
                  required: "Please provide your Phone Number",
                  minlength: "Your Phone Number must be at least 10 digits long"
              },
              <%= cardholdername.UniqueID %>: {
                  required: "Please provide your Cardholder Name",
                  minlength: "Your Cardholder Name must be at least 1 characters long"
              },
              <%= address1.UniqueID %>: {
                  required: "Please provide your Address1",
                  minlength: "Your Address1 must be at least 1 characters long"
              },
              <%= city.UniqueID %>: {
                  required: "Please provide your City",
                  minlength: "Your City Number be at least 1 characters long"
              },

              <%= postcode.UniqueID %>: {
                  required: "Please provide your Postal Code",
                  minlength: "Your Postal Code must be at least 5 digits long",
                  number: "Provide only digits for the postal code"
              },
              <%= telephone.UniqueID %>: {
                  required: "Please provide your Telephone Number",
                  minlength: "Your Telephone number must be at least 10 digits long"
              },
              <%= rblPaymentType.UniqueID %>: {
                  required: "Please select Credit Card Type"
              },
              <%= ccMonth.UniqueID %>: {
                  required: "Please confirm your Credit Card Month",
                  minlength: "Your Credit Card Month must be at least 2 digits long",
                  number: "Provide only digits for the month"
              },
              <%= ccYear.UniqueID %>: {
                  required: "Please confirm your Credit Card Year",
                  minlength: "Your Credit Card Year must be at least 4 digits long",
                  number: "Provide only digits for the year"
              },
              <%= securityCode.UniqueID %>: {
                  required: "Please confirm your Security Code",
                  minlength: "Your Security Code must be at least 3 digits long",
                  number: "Provide only digits for the security code"
              },
              <%= cardnum.UniqueID %>: {
                  required: "Please enter your Credit Card number",
                  number: "Provide only digits for the credit card number"
              }
          },
          errorElement: "li",
          errorLabelContainer: "#errorMessage",
          onsubmit: false

      });

      //validate on change
      $("#firstname").blur(function () {
          var elemTest = $("#firstname").valid();
      });

      $("#lastname").blur(function () {
          var elemTest = $("#lastname").valid();
      });

       $("#phonenumber").blur(function () {
          var elemTest = $("#phonenumber").valid();
      });

      $("#cardholdername").blur(function () {
          var elemTest = $("#cardholdername").valid();
      });

      $("#address1").blur(function () {
          var elemTest = $("#address1").valid();
      });

       $("#city").blur(function () {
          var elemTest = $("#city").valid();
      });

      $("#state").blur(function () {
          var elemTest = $("#state").valid();
      });

      $("#postcode").blur(function () {
          var elemTest = $("#postcode").valid();
      });

      $("#telephone").blur(function () {
          var elemTest = $("#telephone").valid();
      });

      $("#ccMonth").blur(function () {
          var elemTest = $("#ccMonth").valid();
      });

      $("#ccYear").blur(function () {
          var elemTest = $("#ccYear").valid();
      });

      $("#securityCode").blur(function () {
          var elemTest = $("#securityCode").valid();
      });

      $("#rblPaymentType").blur(function () {
          var elemTest = $("#rblPaymentType").valid();
      });

      $("#cardnum").blur(function () {
          var elemTest = $("#cardnum").valid();
      });

      $("#txtemailaddress").blur(function () {
          var elemTest = $("#txtemailaddress").valid();
      });

       $("#cardnum").rules("add", {
      creditcard2:
      //function(){ return $('#cardType').val();
              function () {
                  return $("#rblPaymentType input[type=radio]:checked").val();
       }
      });

 });

  // Get a reference to the PageRequestManager.
  var prm = Sys.WebForms.PageRequestManager.getInstance();

      prm.add_endRequest(EndRequest);

          // Executed when the async postback completes.
  function EndRequest(sender, args) {
      //$(".searchDisplayBusy").hide();

      $(function () {
      $('#btnFinalize').bind({click: validate});
      });

  </script>

Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA

AnswerRe: Calling jquery method from another jquery method Pin
Not Active2-Apr-12 15:57
mentorNot Active2-Apr-12 15:57 
GeneralRe: Calling jquery method from another jquery method Pin
indian1433-Apr-12 5:54
indian1433-Apr-12 5:54 
GeneralRe: Calling jquery method from another jquery method Pin
Not Active3-Apr-12 6:38
mentorNot Active3-Apr-12 6:38 
GeneralRe: Calling jquery method from another jquery method Pin
indian1433-Apr-12 6:58
indian1433-Apr-12 6:58 
AnswerRe: Calling jquery method from another jquery method Pin
jkirkerx3-Apr-12 14:21
professionaljkirkerx3-Apr-12 14:21 
AnswerRe: Calling jquery method from another jquery method Pin
jkirkerx3-May-12 9:01
professionaljkirkerx3-May-12 9:01 
QuestionHosting a WCF service in IIS 7.5 ? Pin
helloworld20202-Apr-12 13:28
helloworld20202-Apr-12 13:28 
Generalquestion???? Pin
pty311-Apr-12 22:04
pty311-Apr-12 22:04 
GeneralRe: question???? Pin
Dalek Dave1-Apr-12 22:13
professionalDalek Dave1-Apr-12 22:13 
GeneralRe: question???? Pin
Not Active2-Apr-12 1:58
mentorNot Active2-Apr-12 1:58 
GeneralRe: question???? Pin
vvashishta24-Apr-12 19:47
vvashishta24-Apr-12 19:47 
QuestionAsp.net Pin
Kalariya Bhargav1-Apr-12 19:06
Kalariya Bhargav1-Apr-12 19:06 
QuestionGridView Pin
gaurav.shukla1431-Mar-12 0:31
gaurav.shukla1431-Mar-12 0:31 
AnswerRe: GridView Pin
Gopal Rakhal31-Mar-12 16:39
Gopal Rakhal31-Mar-12 16:39 
AnswerRe: GridView Pin
Ali Al Omairi(Abu AlHassan)31-Mar-12 20:18
professionalAli Al Omairi(Abu AlHassan)31-Mar-12 20:18 
AnswerRe: GridView Pin
vvashishta24-Apr-12 19:48
vvashishta24-Apr-12 19:48 
Questionhow to deal with change and forgot password.... Pin
Member 784947730-Mar-12 3:31
Member 784947730-Mar-12 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.