search
HomeDevelopment ToolsdreamweaverCustom verification code for SPRY in DreamWeaver CS3

The content of this article is about the custom verification code of SPRY in DreamWeaver CS3. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

In the past two days, I have used the SPRY component in DreamWeaver CS3. Found that it can automatically perform front-end authentication on some inputs. It is quite convenient. It has some built-in verification content, such as: number verification, string verification, postal code verification, date verification, etc.

However, the fly in the ointment is that some of its built-in verifications are not very practical in China, because some of the verifications it provides are based on American standards, which are somewhat different from Chinese standards. gap.

At this time, the only thing that comes to mind is to extend its verification. I don’t want to modify its code because I’m not good enough. See if there are other ways. After looking for some information on the Internet and through my own practice, I finally succeeded. Now assign the code after it.

<span id="sprytextfield1">
<input type="text" name="text1" id="text1"  />
<span class="textfieldRequiredMsg">需要提供一个值。</span>
 <span class="textfieldInvalidFormatMsg">数据无效。</span></span>

This is a piece of code generated by manually dragging a SPRY text box for verification.

The following is a code that declares SPRY

<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField
("sprytextfield1", "custom", {validateOn:["blur"],validation:EXT});
//-->
</script>

The last validation: EXT was added manually by me, indicating that the verification of SPRY is achieved by calling the EXT function. EXT returns True, indicating that the verification passes, EXT returns False, indicating that the verification fails. (EXT is the function name, you can define it by yourself, but this method does not seem to be able to pass parameters)

<script language="javascript">
var EXT = function(){
var objReg=/(13)(\d{9})/;
        t=form1.text1.value;
return objReg.test(t);
    }
</script>

The above code means that when verifying the content of text1, it matches the Chinese mobile phone number.

We can achieve custom verification effects by modifying the EXT function. For example: verify whether the contents in the password box and the repeat password box are the same.

<script language="javascript">
var EXT = function(){
return (form1.Pass.value==form1.RePass.value);
    }
</script>

The above is the detailed content of Custom verification code for SPRY in DreamWeaver CS3. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:博客园. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.