分享验证码和提交按钮

时间:2013-09-05 11:50:47

标签: javascript

我无法解决验证码一整周的问题。我在谷歌找到了简单的数学验证码,现在我需要结合两个按钮:检查(验证码)和一个按钮发送按钮。现在,当我尝试在验证码上正确答案后发送信件时,我看到失败错误。任何建议都会受到很大关注!

<script type="text/javascript">
    var a = Math.ceil(Math.random() * 10);
    var b = Math.ceil(Math.random() * 10);       
    var c = a + b
    function DrawBotBoot()
    {
        document.write("What is "+ a + " + " + b +"? ");
        document.write("<input id='BotBootInput' type='text' maxlength='2' size='2'/>");
    }    
    function ValidBotBoot(){
        var d = document.getElementById('BotBootInput').value;
        if (d == c) return window.open('','_top');        
        return alert(false);
    }
    </script>
 <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
            <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
             <h4>Отправьте сообщение</h4>
            </div>
            <div class="modal-body">
                <form class="contact2" name="contact">
                    <label class="label" for="name">Имя</label><br>
                    <input type="text" name="name" class="input-xlarge"><br>
                    <label class="label" for="email">E-mail</label><br>
                    <input type="email" name="email" class="input-xlarge"><br>
                    <label class="label" for="message">Сообщение</label><br>
                    <textarea name="message" class="input-xlarge"></textarea>
                </form>
            </div>
            <div class="modal-footer">
                       <script type="text/javascript">DrawBotBoot()</script>
<input id="Button1" type="button" value="Check" onclick="ValidBotBoot();"/>
                            <input class="btn btn-warning" type="submit" value="Отправить" id="submit2">
                <a href="#" class="btn btn-danger" data-dismiss="modal">Закрыть</a>
            </div>

0 个答案:

没有答案