zoukankan      html  css  js  c++  java
  • 客户端控件Javascript验证类 yangan

    通过使用javascript在客户端验证输入值的有效性,能够有效的保证数据的有效性,并减轻了服务器端验证给服务器带来的负担。下面介绍函数库及使用方式:

    1、验证函数库: 

    代码
    /*包括在validator.js文件中*/
    /***************************************************************************
    函数名称:fucCheckNull
    函数功能:检查是否为空
    参数 :strTemp 要检查的字符串
    参数 :strAlertMsg 要显示的提示信息
    返回 :消息提示框 true/false
    日期 :2003-10-17
    作者 :Elvis
    修改人 :
    修改日 :
    ******************************************************************************/

    function fucCheckNull(strTemp,strAlertMsg)
    {
    strTemp=strTemp.replace(/^(\s)*|(\s)*$/g,"");//去掉字符串两边的空格
    if (strTemp.length
    <1)
    {
    alert(strAlertMsg);
    return false;
    }
    }


     

  • 相关阅读:
    spring cloud教程
    ideaaaaaaaaa
    Django
    Django 基础介绍
    Pychram
    python
    python
    python
    Python
    Python -- Scrapy 命令行工具(command line tools)
  • 原文地址:https://www.cnblogs.com/xlx0210/p/1661720.html
Copyright © 2011-2022 走看看