Search This Blog

Wednesday, 9 April 2014

check validation inside gridview using jquery

  $(document).ready(function () {

                    $('input[id*="btnSave"]').bind('click', variationSupportValidation);
                });

    function variationSupportValidation() {                                           
                    var shouldShowAlert = false;
                    $('div[id*="rgrdCastItemlevel"]').find('input').each(function (i) {
                                        
                        if ($.trim($(this).val()).length > 0) {
                            var tempSupportPercent = $.trim($(this).val()).replace(/[%,]+/g, '');
                            if (tempSupportPercent >= 100) {                                                       
                                shouldShowAlert = true;
                            }
                        };
                    });

                    if (shouldShowAlert) {
                        alert("Validation message");
                        return !shouldShowAlert;
                    }
                }

1 comment:

  1. It was so nice article and useful to Informatica learners. we also provide Dotnet Course online training our Cubtraining is leader in providing Software Training

    ReplyDelete