0

I have problem when using my ajax form inside the lightbox div .

the form worked outside the lightbox .

after submit the form , I cannot recieve the variable from the form , I see it empty .

I am using lightbox from here: http://www.aerowebstudio.net/codecanyon/jquery.lightbox/

the html example "

<html>
<head>

<script type="text/javascript">
            function send_ajax_data() {
                var reg_user = document.getElementById('reg_user').value;
                reg_user2 = document.getElementById('reg_user2').value;
                reg_pass = document.getElementById('reg_pass').value;
                reg_pass2 = document.getElementById('reg_pass2').value;
                reg_email = document.getElementById('reg_email').value;
                alert(reg_user);
            }
        </script>
        <script type="text/javascript">
            $(document).ready(function(){
                $('div.lightbox').lightbox();
            });
        </script>

</head>
<body>

<div id="signup" style="width:756px; margin-right:auto;margin-left:auto;">
        <div class="light-box">

        <div class="center">
        <div class="welcome">
        <h1>Hello</h1>

        </div>

        <div id="reg_stats"></div>
        <div class="login-form">
        <div class="form-container">
            <label class="label">xxx</label>
            <input id="reg_user" type="text" />
            <label class="label">xxx</label>
            <input id="reg_user2" type="text" />
            <label class="label">xxx</label>
            <input id="reg_email" type="text" />
            <label class="label">xxx</label>
            <input id="reg_pass" type="text" />
            <label class="label">xxx</label>
            <input id="reg_pass2"  type="text" />
            <input type="submit" onclick="send_ajax_data();" class="login-btn" value="Done" />
        </div>
        </div>

        </div>
    </div>
</div>
<a href="#signup" class="lightbox">new user</a>


</body>
</html>
4

1 回答 1

0

尝试添加表单标签?

如果没有包含输入的表单,就没有什么可以提交的。

于 2012-11-10T16:07:19.163 回答