custom validation

 var process = 0;
                              var packageselected = $("input[name='package']:checked").val();
                              var blitzname = $('#blitzname').val();
                              var wifi_ssid = $('#wifi_ssid').val();
                              var blitz_addr = $('#blitz_addr').val();
                              var blitz_phone_number = $('#blitz_phone_number').val();
                              var email_id = $('#email_id').val();
                              var  personal_name  = $('#personal_name').val();
                              var blitz_website = $('#blitz_website').val();
                              var  personal_phone_number  = $('#personal_phone_number').val();
                              var emailReg = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
                              var valid = emailReg.test(email_id);
                              if (blitzname == '') {
                                        $('#blitzname').addClass('error');
                                        $('#blitzname').keypress(function () {
                                                  $('#blitzname').removeClass('error');
                                        });
                              }
                             
                              if ((wifi_ssid == '')&& (packageselected != 'silver' ) ){
                                        $('#wifi_ssid').addClass('error');
                                        $('#wifi_ssid').keypress(function () {
                                                  $('#wifi_ssid').removeClass('error');
                                        });
                              }
                              if (email_id == '' || !valid) {
                                        $('#email_id').addClass('error');
                                        $('#email_id').keypress(function () {
                                                  $('#email_id').removeClass('error');
                                        });

                              }
                              if (blitzname == '' || email_id == '' || !valid) {
                                        $('.errorMessage').fadeIn('medium');
                                        return false;
                              }else{
                                        process = 1;
                              }

1 comments:

Unknown
10 December 2015 at 04:15 comment-delete

Excellent list of some Java questions and answers for developer.
Thanks...for sharing some interesting questions . I must admit, I have never encounter the these type of list before. I am an java developer but I also do not able to easily found the list of Java questions and answers .
on various blogs. I am looking for such type of blog or Website on google, coincidentally I found your blog and found your blog very nice.

Reply

Post a Comment

Don't Forget to comment