Home > Web Front-end > JS Tutorial > When jqGrid increases - determine the start date and end date (example analysis)_jquery

When jqGrid increases - determine the start date and end date (example analysis)_jquery

WBOY
Release: 2016-05-16 17:16:58
Original
1199 people have browsed it
Copy code The code is as follows:

$("#btnAddSaveTestSubject").click(function () {
//Validation when adding, save
jQuery.validator.addMethod("admissionBatch", function (value, element) {
                                                                                                                                    { ) {
                                                                                                                                                                                                                      ; ; : "blur",
debug: true,
ignore: ":hidden",
errorElement: "div",
wrapper: "div",
errorPlacement : function (error, element ) {
            error.addClass('message');                                                     “etsadd_admissionBatch”: {
required: true,
                  admissionBatch: true
                                                                                                                                                                         true, ~ 🎜>             required: true,
            professionalProperty: true
                             
“etsadd_admissionBatch”: {
“etsadd_admissionBatch”: {
>            admissionBatch: "Please select the admission batch"                                                                                                                                                                       🎜>                                                                                                                                               ,
         "etsadd_professionalProperty": {
                                                                                                                                                      }
},
submitHandler: function (form) { var IDARRAY = jquery ("#Testsubjectgrid"). Jqgrid ('Getgridparam', 'Selrrow'); // Get the line
if (IDARRAY == NULL || IDARAY == "" ) {
                 jAlert("Please select a test subject!", "Prompt information"); ; i < idArray.length; i ) {
if ($ ("#Exam_begintime_" IDARRAY [i]. Val () == "") {
jalert ("Test subjects" jQuery ("#Testsubjectgrid"). [i], "display_content") "The start time cannot be empty!", "Prompt information");
                                                                                                                                                           idArray[i]). val() == "") {
                                             jAlert("Test Subject" jQuery("#testSubjectGrid").jqGrid("getCell", idArray[i], "display_content") "The end time cannot be empty!" , "Prompt information");
                                                                                                                                                                                                                         -([/d ]{1,2}; ();
var arr_dt1, arr_dt2;
arr_dt1 = begindata.match(reg_ymd);
arr_dt2 = enddata. match(reg_ymd);
                                          begindata = new Date(arr_dt1[1] "/" arr_dt1[2] “/” arr_dt1[3]); enddata ) {
Jalert ("Test subjects" jQuery ("#TestsubjectGrid"). Jqgrid ("Getcell", Idarray [i], "Display_Content") cannot be greater than the end of the end! "," Tips ");
                             return;                                                                 jAlert("Test Subject" jQuery("#testSubjectGrid" ).jqGrid("getCell", idArray[i], "display_content") "The exam session cannot be empty!", "Prompt information");
                                         If ($(" #exam_turn_" idArray[i]).val() != "") {
                               var re = /^[-/]?/d (/./d)? $/;
                                            ("#exam_turn_" idArray[i]).val();
                                                                                                                                                                    rid("getCell ", idArray[i], "display_content") "The exam number must be a number!", "Prompt information");
                                                  If ($("#exam_turn_" idArray[ i]).val().length > 8) {
                                                                                                                                                                                                                                                                           Cannot be larger than 8 digits!", "Prompt message");
                                                                                                                                                                                        
                }
                if ($("#AddEntranceTestSubjectFrom").validate().form())
                    $("#AddEntranceTestSubjectFrom").ajaxSubmit({
                        url: "/EntryTestsubjectsSet/AddTestSubject/",
                        dataType: 'json',
                        clearForm: false,
                        data: {
                            strJson: JSON.stringify({
                                test_course_id: idArray.join("&")
                            })
                        },
                        success: function (data) {
                            var json = eval("(" data ")");
                            jAlert(json.msg, "提示信息");
                            if (json.suc == 1) {
                                $("#entranceTestSubjcetMask").hide();
                                $("#entranceAddTestSubjectSet").hide();
                                $("#entranceTestSubjectGrid").trigger("reloadGrid");
                                reloadNum ;
                            }
                        }
                    });
            }
        });
    });
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template