密码HTML重定向 [英] Password HTML redirect

查看:74
本文介绍了密码HTML重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要点:$ b​​ $ b我不介意用户是否可以使用 - 查看源代码来查看它。
我对这件事并不十分了解,但是我真的很希望能够实现这一点。

Points: I dont mind if users can see it using - view source. I don't really know much about this but I really want to get this working.

我需要为此添加一个密码,我需要它所以如果一个人输入hello,它会重定向,如果有其他东西被输入,什么也不会发生。

I need to add a password to this somehow, I need it so that if a person enters "hello" it will redirect, if anything else is entered nothing happens.

<div class="wrapper">

    <form class="form1" action="http://google.com">

        <div class="formtitle">Enter the password to proceed</div>

        <div class="input nobottomborder">
            <div class="inputtext">Password: </div>
            <div class="inputcontent">

                <input type="password" />
                <br/>

            </div>
        </div>

        <div class="buttons">

            <input class="orangebutton" type="submit" value="Login" />


        </div>

</div>  


推荐答案

假设使用重定向,您的意思是允许表单提交,

Assuming that with redirect you mean to allow the form to submit,

为您的密码字段命名

<input type="password" name="pass" />

并更改

and change

<form class="form1" action="http://google.com">

<form class="form1" action="http://google.com" onsubmit="return (this.pass.value==='hello')?true:false;">

演示 http://jsfiddle.net/nCfQ4/1/

这篇关于密码HTML重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆