小编430*_*836的帖子

如何使用html格式的java脚本创建文本验证码

<html>
    <body>
        <form action="Send_Contact_Us.php" method="post" onSubmit="return checkform(this);">
            <label>Name</label>
            <input name="name" type="text" required="required" />
            <label>Email</label>
            <input name="mail" type="email" required="required" />
            <label>Phone</label>
            <input type="text" name="phone" pattern="[789][0-9]{9}" required="required" />
            <label>Comments</label>
            <textarea name="comment" rows="3" cols="20" required="required"></textarea>
            <label for="code">Write code below <span id="txtCaptchaDiv" style="color:#F00"></span>
                <!-- this is where the script will place the generated code -->
                <br/>
                <input type="hidden" id="txtCaptcha" />
            </label>
            <input type="text" name="txtInput" id="txtInput" size="30" onfocus="validatePass(document.getElementById('txtCaptcha'), this);" oninput="validatePass(document.getElementById('txtCaptcha'), this);" />
            <input type="submit" />
        </form>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

这是我想使用JavaScript在文本字段上方生成代码的表单代码.

html javascript

0
推荐指数
1
解决办法
6万
查看次数

标签 统计

html ×1

javascript ×1