我的zhiwen(三)dialog

2 篇文章 0 订阅
1 篇文章 0 订阅
 //登入时  信息提示
    $("#loading").dialog({
        autoOpen:false,
        modal :true,
        closeOnEscape :false,
        resizeable : false,
        draggable : false,
        width: 180,
        height : 50,
    }).parent().find('.ui-widget-header').hide();

    $("#reg").dialog({
        autoOpen: false,
        modal: true, //定义了这个属性  其他的地方就不可以操作
        resizable: false,
        width: 320,
        height: 340,
        buttons:{
            '提交':function(){
                  $(this).submit();
            }
        }
    }).validate({
        //提交按钮操作
        submitHandler :function(form){
            $(form).ajaxSubmit({
                url: "add.php",
                type: "POST",
                beforeSubmit :function(formData, jqForm, options ){
                    $('#loading').dialog('open');
                    $('#reg').dialog('widget').find('button').eq(1).button('disable');      
                },
                success :function(responseText ,statusText){
                    if(responseText){
                        $("#reg").dialog('widget').find('button').eq(1).button('enable');
                        $('#loading').css('background','url(css/images/success.gif) no-repeat 20px center').html('数据新增成功!');
                        $.cookie('user',$('#user').val());
                        setTimeout(function(){
                            $('#loading').dialog('close');
                            $('#reg').dialog('close');
                            $('#reg').resetForm();
                            $('#reg span.star').html('*').removeClass('succ');
                            $('#loading').css('background','url(css/images/loading.gif) no-repeat 20px center').html('数据交互中......');
                            $('#reg input').css('border','1px solid #ccc');
                            $('#member, #quit').show();
                            $('#reg_a, #login_a').hide();
                            $('#member').html("用户["+$.cookie('user')+"]");
                        },1000);
                    }
                }
            });

        },

        //出现错误时  调用的方法
        showErrors :function(){
            var  errors=this.numberOfInvalids();
            if(errors > 0){
                $("#reg").dialog('option','height',errors*20+340);
            }else{
                $("#reg").dialog('option','height',340);
            }
            this.defaultShowErrors();
        },

        highlight :function (element,errorClass){
            $(element).css('border','1px solid #630');
            $('#reg span.star').html('*').removeClass('succ');
        },

        unhighlight :function(element,errorClass){
            $(element).css("border",'1px solid #000');
           //接下来是把*号 换成一个钩
            $(element).parent().find('span').html(" ");
            $(element).parent().find('span').addClass('succ');

        },

        errorLabelContainer :' ol.reg_error',
        wrapper :'li',
        rules: {
            user: {
                required: true,
                minlength: 2,
                remote : {
                    url : 'is_user.php',
                    type : 'POST'
                }
            },
            pass :{
                required: true,
                minlength: 6,
            },
            email : {
                required :true,
                email :true,
            },
           
        },
        messages :{
            user: {
                required : '账号不得为空!',
                minlength :jQuery.format('账号不得小于{0}位'),
                remote : '账号被占用!!!'
            },
            pass: {
                required : '密码不得为空!',
                minlength :jQuery.format('密码不得小于{0}位'),
            },
            email: {
                required : '请输入正确的邮箱地址!',
            }
        }

    });



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
7-3 Score Processing 分数 10 作者 翁恺 单位 浙江大学 Write a program to process students score data. The input of your program has lines of text, in one of the two formats: Student's name and student id, as <student id>, <name>, and Score for one student of one course, as <student id>, <course name>, <marks>. Example of the two formats are: 3190101234, Zhang San 3190101111, Linear Algebra, 89.5 Comma is used as the seperator of each field, and will never be in any of the fields. Notice that there are more than one word for name of the person and name of the course. To make your code easier, the score can be treated as double. The number of the students and the number of the courses are not known at the beginning. The number of lines are not known at the beginning either. The lines of different format appear in no order. One student may not get enrolled in every course. Your program should read every line in and print out a table of summary in .csv format. The first line of the output is the table head, consists fields like this: student id, name, <course name 1>, <course name 2>, ..., average where the course names are all the courses read, in alphabet order. There should be one space after each comma. Then each line of the output is data for one student, in the ascended order of their student id, with score of each course, like: 3190101234, Zhang San, 85.0, , 89.5, , , 87.3 For the course that hasn't been enrolled, leave a blank before the comma, and should not get included in the average. The average has one decimal place. There should be one space after each comma. And the last line of the output is a summary line for average score of every course, like: , , 76.2, 87.4, , , 76.8 All the number output, including the averages have one decimal place. Input Format As described in the text above. Output Format As described in the text above. The standard output is generated by a program compiled by gcc, that the round of the first decimal place is in the "gcc way". Sample Input 3180111435, Operating System, 34.5 3180111430, Linear Algebra, 80 3180111435, Jessie Zhao 3180111430, Zhiwen Yang 3180111430, Computer Architecture, 46.5 3180111434, Linear Algebra, 61.5 3180111434, Anna Teng Sample Output student id, name, Computer Architecture, Linear Algebra, Operating System, average 3180111430, Zhiwen Yang, 46.5, 80.0, , 63.2 3180111434, Anna Teng, , 61.5, , 61.5 3180111435, Jessie Zhao, , , 34.5, 34.5 , , 46.5, 70.8, 34.
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值