CN107766124A - A kind of automatic verification method and device of WEB lists - Google Patents

A kind of automatic verification method and device of WEB lists Download PDF

Info

Publication number
CN107766124A
CN107766124A CN201711014172.4A CN201711014172A CN107766124A CN 107766124 A CN107766124 A CN 107766124A CN 201711014172 A CN201711014172 A CN 201711014172A CN 107766124 A CN107766124 A CN 107766124A
Authority
CN
China
Prior art keywords
list
verified
web
automatic
verifies
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711014172.4A
Other languages
Chinese (zh)
Inventor
张扬嵩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Star Software Co Ltd
Original Assignee
Fujian Star Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Star Software Co Ltd filed Critical Fujian Star Software Co Ltd
Priority to CN201711014172.4A priority Critical patent/CN107766124A/en
Publication of CN107766124A publication Critical patent/CN107766124A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging

Abstract

The present invention provides a kind of automatic verification method of WEB lists, sets the Authentication-Type that must fill out attribute and all input controls of all input controls in WEB page list;After the completion of WEB page loading, set all input controls in list that there is the verification tip information placeholder that must be filled out mark and needs and verify that must fill out attribute, and form validation method and submission event are bound;It is automatic to call list verification method to be verified when list is submitted, if being verified, submission form content to server;Otherwise, miscue information is shown;Alleviate the software development workload estimate of WEB service system.

Description

A kind of automatic verification method and device of WEB lists
Technical field
The present invention relates to a kind of automatic verification method and device of WEB lists.
Background technology
WEB lists typically require and the list content of submission are first verified that the method for checking is a variety of, has when submitting It is direct in javascript programs in list each needs verify input frame carry out checking judgement, if by testing Card is with regard to submission form to WEB service end, if not by suggesting that and returning, this method is simple and clear, but size of code is big, can Maintainability is poor;Have plenty of and the method and prompt message of javascript checkings are packaged, then submitting WEB lists When call encapsulation checking judged, if by verify with regard to submission form to WEB service end, if not by suggesting that simultaneously Return, it is maintainable also poor although this method size of code is smaller, because the program code judged is also relatively more.
The content of the invention
The technical problem to be solved in the present invention, it is to provide a kind of automatic verification method and device of WEB lists, mitigates The software development workload estimate of WEB service system.
What one of present invention was realized in:A kind of automatic verification method of WEB lists, comprises the following steps:
Step 1, the checking class that must fill out attribute and all input controls that all input controls in WEB page list are set Type;
After the completion of step 2, WEB page loading, all input controls in list are set to have must fill out attribute must fill out mark The verification tip information placeholder that will and needs are verified, and form validation method and submission event are bound;
It is automatic to call list verification method to be verified when step 3, list are submitted, if being verified, in submission form Hold to server;Otherwise, miscue information is shown.
Further, it is described set list in all input controls have must fill out attribute must fill out mark further it is specific For:All input control object arrays with required attributes in list are taken out, circulate each input control member in array Element, and before the label of input control element add setting must fill out tag mark.
Further, form validation method includes in the step 2:Checking is not short side method, verifies integer method, checking Phone number method, ID card No. method is verified, verify digital method, verify email method, and checking canonical table Up to formula method.
Further, the step 3 is specially further:When submission form, judging whether list is set needs to verify, If desired verify, then call list verification method to be verified automatically, if being verified, submission form content to server; Otherwise, miscue information is shown;
If need not verify, direct submission form to server.
Further, show that error message is specially further described in the step 3:Call form object Validate methods, error message is shown by the callback method of this method.
What one of present invention was realized in:A kind of automatic checking device of WEB lists, including following module:
Business module, set all input controls in WEB page list must fill out testing for attribute and all input controls Demonstrate,prove type;
Initialization module, after the completion of WEB page loading, set all input controls in list have must fill out attribute must Fill out mark and need the verification tip information placeholder verified, and form validation method and submission event are bound;
Authentication module, it is automatic to call list verification method to be verified when list is submitted, if being verified, submit table Single content is to server;Otherwise, miscue information is shown.
Further, the initialization module is specially further:Take out all with required attributes in list Input control object array, each input control element in array is circulated, and set being added before the label of input control element Fixed must fill out tag mark.
Further, form validation method includes in the initialization module:Checking is not short side method, verifies integer side Method, phone number method is verified, verify ID card No. method, verify digital method, verify email method, and checking Regular expression method.
Further, the authentication module is specially further:When submission form, judge whether list sets needs to test Card, is if desired verified, then calls list verification method to be verified automatically, if being verified, submission form content to service Device;Otherwise, miscue information is shown;
If need not verify, direct submission form to server.
Further, show that error message is specially further described in the authentication module:Call form object Validate methods, error message is shown by the callback method of this method.
The invention has the advantages that:The present invention a kind of automatic verification method and device of WEB lists, are submitted in list Shi Zidong carries out form validation, greatly reduces the javascript codes of WEB service forms pages module;Very big alleviates The software development workload estimate of WEB service system;Because realizing loose coupling between WEB service system module, system is improved It is maintainable.
Brief description of the drawings
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is the inventive method execution flow chart.
Embodiment
As shown in figure 1, the automatic verification method of WEB lists of the present invention, comprises the following steps:
Step 1, the checking class that must fill out attribute and all input controls that all input controls in WEB page list are set Type;
After the completion of step 2, WEB page loading, all input controls in list are set to have must fill out attribute must fill out mark The verification tip information placeholder that will and needs are verified, and form validation method and submission event are bound, it is described to fill out Traffic sign placement method:All input control object arrays with required attributes in list are taken out, are circulated each in array Input control element, and the tag mark that must fill out that setting is added before the label of input control element (is needed to change in user It when must fill out mark, can easily be changed very much, size of code be reduced, for example, being changed into triangle etc. from asterisk);It is described Form validation method includes:Checking is not short side method, verifies integer method, verifies phone number method, verifies ID card No. Method, digital method is verified, verify email method, and checking regular expression method;
Step 3, when submission form, judging whether list is set needs to verify, if desired verifies, then automatically call list Verification method is verified, if being verified, submission form content to server;Otherwise, miscue information is shown;
If need not verify, direct submission form to server.
It is described to show that error message is specially further:The validate methods of form object are called, pass through this method Callback method shows error message.
The automatic checking device of WEB lists of the present invention, including following module:
Business module, set all input controls in WEB page list must fill out testing for attribute and all input controls Demonstrate,prove type;
Initialization module, after the completion of WEB page loading, set all input controls in list have must fill out attribute must Fill out mark and need the verification tip information placeholder verified, and form validation method and submission event are bound, it is described Traffic sign placement method must be filled out:All input control object arrays with required attributes in list are taken out, are circulated in array Each input control element, and that must fill out tag mark plus setting before the label of input control element, the list is tested Card method includes:Checking is not short side method, verifies integer method, verifies phone number method, verifies ID card No. method, tests Digital method is demonstrate,proved, verifies email method, and checking regular expression method;
Authentication module, when submission form, judging whether list is set needs to verify, if desired verifies, then automatic to call Form validation method is verified, if being verified, submission form content to server;Otherwise, miscue information is shown;
If need not verify, direct submission form to server.
It is described to show that error message is specially further:The validate methods of form object are called, pass through this method Callback method shows error message.
A kind of embodiment of the present invention:
Scenario-frame:
WEB form validation expansion modules, WEB form validation initialization modules, WEB service forms pages module
Key step:
First, WEB form validations expansion module
1) setting increases the method for red asterisk before the title of required field in list, it is form object that method, which enters ginseng, real Existing method is to take out all input frame object arrays with required attributes in ginseng form object, is circulated each in array Input frame element and red asterisk is added before the label of input frame element, this input frame is marked with such method Content can not be sky.
2) checking is not short side method, verifies integer method, verifies phone number method, verifies ID card No. method, tests Digital method is demonstrate,proved, verifies email method, verifies regular expression method, the ginseng that enters of these methods is Authentication-Type (if not For sky, cell-phone number etc.) and value to be verified;
3) list submits event binding method, is called when list is submitted, judging whether list is set needs to verify, such as Fruit needs to verify the Authentication-Type and validation value for regard to all input controls in searching loop list, taking out input control, this Two values call 2) the corresponding verification method of step as actual parameter.
4) when the obstructed out-of-date method that error message is shown using word block mode of form validation, it is list pair that method, which enters ginseng, As implementation method is to call the validate methods of form object, passes through the callback method processing character block side of this method Formula shows error message.
2nd, WEB form validations initialization module
1) WEB form validations initialization module is exactly that the list that WEB page has been loaded in the current whole documents of circulation is automatic Calling WEB form validation expansion modules in the offer realized set and increase red asterisk in list before the title of required field Method and the offer realized automatically is called in WEB form validation expansion modules obstructed out-of-date to use word when list needs to verify The method that block mode shows error message, so when this module is quoted by WEB page, this method will be called, so Initialization process is carried out to the list in WEB page afterwards.
3rd, WEB service forms pages module
1) WEB form validations initialization module and WEB form validation expansion modules are introduced in WEB service forms pages Javascript files.
2) it input frame is set in WEB service forms pages in list must fill out, the css of Email, network address, cell-phone number etc. Class name.
3) function of form validation will be carried out when list is submitted in WEB service forms pages module automatically.
The present invention advantage be the javascript code wraps verified to WEB lists into plug-in unit, WEB lists are entered As long as the WEB page of row checking introduces packaged javascript plug-in units, in this way it is no longer necessary to writes any related Also without calling verification method when javascript proving programs code and submission, it is only necessary to set list to need the category verified Property and input frame must be filled out, type (such as Cipher Strength, whether input handset number, Email, numeral, integer) etc. some Attribute can, can be verified automatically when list is submitted, if by checking with regard to submission form to WEB service end, such as Fruit reduces javascript program codes and improved maintainable to greatest extent not by suggesting that and returning.
Although the foregoing describing the embodiment of the present invention, those familiar with the art should manage Solution, the specific embodiment described by us are merely exemplary, rather than for the restriction to the scope of the present invention, are familiar with this The equivalent modification and change that the technical staff in field is made in the spirit according to the present invention, should all cover the present invention's In scope of the claimed protection.

Claims (10)

  1. A kind of 1. automatic verification method of WEB lists, it is characterised in that:Comprise the following steps:
    Step 1, the Authentication-Type that must fill out attribute and all input controls that all input controls in WEB page list are set;
    Step 2, WEB page loading after the completion of, set list in all input controls have must fill out attribute must fill out mark and The verification tip information placeholder verified is needed, and form validation method and submission event are bound;
    It is automatic to call list verification method to be verified that, if being verified, submission form content is extremely when step 3, list are submitted Server;Otherwise, miscue information is shown.
  2. A kind of 2. automatic verification method of WEB lists as claimed in claim 1, it is characterised in that:Institute in the setting list The mark that must fill out of attribute must be filled out and be specially further by having input control to have:Take out all with required attributes in list Input control object array, each input control element in array is circulated, and set being added before the label of input control element Fixed must fill out tag mark.
  3. A kind of 3. automatic verification method of WEB lists as claimed in claim 1, it is characterised in that:List is tested in the step 2 Card method includes:Checking is not short side method, verifies integer method, verifies phone number method, verifies ID card No. method, tests Digital method is demonstrate,proved, verifies email method, and checking regular expression method.
  4. A kind of 4. automatic verification method of WEB lists as claimed in claim 1, it is characterised in that:The step 3 further has Body is:When submission form, judging whether list is set needs to verify, if desired verifies, then calls list verification method automatically Verified, if being verified, submission form content to server;Otherwise, miscue information is shown;
    If need not verify, direct submission form to server.
  5. A kind of 5. automatic verification method of WEB lists as described in claim 1 or 4, it is characterised in that:Institute in the step 3 Stating display error message is specially further:The validate methods of form object are called, are shown by the callback method of this method Show error message.
  6. A kind of 6. automatic checking device of WEB lists, it is characterised in that:Including following module:
    Business module, the checking class that must fill out attribute and all input controls of all input controls in WEB page list is set Type;
    Initialization module, after the completion of WEB page loading, all input controls in list are set to have must fill out attribute must fill out mark The verification tip information placeholder that will and needs are verified, and form validation method and submission event are bound;
    Authentication module, it is automatic to call list verification method to be verified when list is submitted, if being verified, in submission form Hold to server;Otherwise, miscue information is shown.
  7. A kind of 7. automatic checking device of WEB lists as claimed in claim 6, it is characterised in that:The initialization module enters One step is specially:All input control object arrays with required attributes in list are taken out, are circulated each defeated in array Enter control element, and tag mark must be filled out add setting before the label of input control element.
  8. A kind of 8. automatic checking device of WEB lists as claimed in claim 6, it is characterised in that:In the initialization module Form validation method includes:Checking is not short side method, verifies integer method, verifies phone number method, verifies ID card No. Method, digital method is verified, verify email method, and checking regular expression method.
  9. A kind of 9. automatic checking device of WEB lists as claimed in claim 6, it is characterised in that:The authentication module enters one Step is specially:When submission form, judging whether list is set needs to verify, if desired verifies, then calls form validation automatically Method is verified, if being verified, submission form content to server;Otherwise, miscue information is shown;
    If need not verify, direct submission form to server.
  10. A kind of 10. automatic checking device of WEB lists as described in claim 6 or 9, it is characterised in that:The authentication module Described in show that error message is specially further:The validate methods of form object are called, pass through the readjustment side of this method Faxian shows error message.
CN201711014172.4A 2017-10-26 2017-10-26 A kind of automatic verification method and device of WEB lists Pending CN107766124A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711014172.4A CN107766124A (en) 2017-10-26 2017-10-26 A kind of automatic verification method and device of WEB lists

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711014172.4A CN107766124A (en) 2017-10-26 2017-10-26 A kind of automatic verification method and device of WEB lists

Publications (1)

Publication Number Publication Date
CN107766124A true CN107766124A (en) 2018-03-06

Family

ID=61271614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711014172.4A Pending CN107766124A (en) 2017-10-26 2017-10-26 A kind of automatic verification method and device of WEB lists

Country Status (1)

Country Link
CN (1) CN107766124A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509246A (en) * 2018-04-08 2018-09-07 重庆满惠网络科技有限公司 A kind of self-defined verification method of web form and system
CN108959218A (en) * 2018-04-26 2018-12-07 北京五八信息技术有限公司 Form validation method and device, electronic equipment and computer readable storage medium
CN109324841A (en) * 2018-10-09 2019-02-12 郑州云海信息技术有限公司 A kind of method and device for improving form validation Validform
CN110472200A (en) * 2019-07-29 2019-11-19 深圳市中兴新云服务有限公司 A kind of data processing method based on list, device and electronic equipment
CN111144075A (en) * 2019-12-02 2020-05-12 江苏艾佳家居用品有限公司 Automatic verification method based on dynamic combination strategy of web end form and verification rule
CN111596987A (en) * 2020-04-24 2020-08-28 北京字节跳动网络技术有限公司 Page display method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576823A (en) * 2009-06-11 2009-11-11 阿里巴巴集团控股有限公司 Method for verifying form control and device
CN102023869A (en) * 2010-12-30 2011-04-20 深圳联友科技有限公司 Control input value checking method and system
CN104750864A (en) * 2015-04-16 2015-07-01 北京齐尔布莱特科技有限公司 Universal text checking method
CN104899027A (en) * 2015-05-22 2015-09-09 国云科技股份有限公司 Universal form verification method for js
CN105426183A (en) * 2015-11-12 2016-03-23 天津车之家科技有限公司 Form verification method
US9514115B2 (en) * 2014-12-31 2016-12-06 Shih-Hsin Chen Method for creating form validation program and corresponding form interface according to result set metadata

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576823A (en) * 2009-06-11 2009-11-11 阿里巴巴集团控股有限公司 Method for verifying form control and device
CN102023869A (en) * 2010-12-30 2011-04-20 深圳联友科技有限公司 Control input value checking method and system
US9514115B2 (en) * 2014-12-31 2016-12-06 Shih-Hsin Chen Method for creating form validation program and corresponding form interface according to result set metadata
CN104750864A (en) * 2015-04-16 2015-07-01 北京齐尔布莱特科技有限公司 Universal text checking method
CN104899027A (en) * 2015-05-22 2015-09-09 国云科技股份有限公司 Universal form verification method for js
CN105426183A (en) * 2015-11-12 2016-03-23 天津车之家科技有限公司 Form verification method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509246A (en) * 2018-04-08 2018-09-07 重庆满惠网络科技有限公司 A kind of self-defined verification method of web form and system
CN108959218A (en) * 2018-04-26 2018-12-07 北京五八信息技术有限公司 Form validation method and device, electronic equipment and computer readable storage medium
CN109324841A (en) * 2018-10-09 2019-02-12 郑州云海信息技术有限公司 A kind of method and device for improving form validation Validform
CN109324841B (en) * 2018-10-09 2021-11-26 郑州云海信息技术有限公司 Method and device for improving form verification Validform
CN110472200A (en) * 2019-07-29 2019-11-19 深圳市中兴新云服务有限公司 A kind of data processing method based on list, device and electronic equipment
CN110472200B (en) * 2019-07-29 2023-10-27 深圳市中兴新云服务有限公司 Form-based data processing method and device and electronic equipment
CN111144075A (en) * 2019-12-02 2020-05-12 江苏艾佳家居用品有限公司 Automatic verification method based on dynamic combination strategy of web end form and verification rule
CN111596987A (en) * 2020-04-24 2020-08-28 北京字节跳动网络技术有限公司 Page display method and device and electronic equipment
CN111596987B (en) * 2020-04-24 2024-03-26 北京字节跳动网络技术有限公司 Page display method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN107766124A (en) A kind of automatic verification method and device of WEB lists
CN103020826B (en) Payment processing method and server
CN106990952B (en) Form verification method and system based on Vue
CN108446225A (en) Creating device, method and the computer readable storage medium of analog interface
CN109828903A (en) Automated testing method, device, computer installation and storage medium
CN107679418A (en) Data desensitization method, server and storage medium
WO2020024419A1 (en) Testing method for service scenario, electronic device and readable storage medium
CN103440198B (en) Form validation method
CN109308285A (en) Database script management method, device, computer equipment and storage medium
CN110377462B (en) Interface testing method and device and terminal equipment
CN108089985B (en) Method, device and equipment for verifying interface return parameters and readable storage medium
CN107577622A (en) Back end interface analogy method, equipment and storage medium
CN111290742A (en) Parameter verification method and device, electronic equipment and readable storage medium
CN108959218A (en) Form validation method and device, electronic equipment and computer readable storage medium
CN106899445A (en) The method and system of page interface automatic test
CN109284198A (en) A kind of method and apparatus verifying data
CN107102908A (en) Data verification method, data fault tolerance method and device
CN109669859A (en) Service test method, device, computer equipment and storage medium
CN110309099A (en) Interface managerial method, device, equipment and computer readable storage medium
CN109165017A (en) Data verification method, device and computer storage medium
CN106453263A (en) Method and system of binding cellphone number with APP
CN110334303A (en) Form validation method, device, computer equipment and storage medium
CN108183911A (en) A kind of method, device and mobile terminal of batch replacement binding cell-phone number
CN108269048A (en) A kind of declaration system and method for supporting a variety of tax declaration modes
US8010893B2 (en) Electronic document with selectively editable fields and methods for same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination