0

我正在使用 grails 2.1.1 并尝试使用模式窗口注册一个新用户。我的注册模式窗口的 .gsp 代码如下...

....
    <!--Start of Registration Modal Page-->
<div id="register" class="modal hide fade" aria-labelledby="modalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
            <i class="icon-remove"></i>
        </button>
            <h3 id="modalLabel">
                Register
            </h3>
    </div>
    <div class="modal-body">
        <g:form method="POST">
        <div class="controls controls-row">
            <div class="span1"></div>
            <input type="text" class="span2" placeholder="Full Name" value="${user?.profile?.fullName}">
            <div class="span1"></div>
        </div>
        <div class="controls controls-row">
            <div class="span1"></div>
            <input type="text" class="span3" placeholder="Email" value="${user?.profile?.email}">
            <div class="span1"></div>
        </div>
        <div class="controls controls-row">
            <div class="span1"></div>
            <input type="text" class="span3" placeholder="Username" value="${user?.username}">
            <div class="span1"></div>
        </div>
        <div class="controls controls-row">
            <div class="span1"></div>
            <input type="password" class="span3" placeholder="Password" value="${user?.password}">
            <div class="span1"></div>
         </div>
            <div class="controls controls-row">
                <div class="span1"></div>
                <input type="text" class="span3" placeholder="Bio" value="${user?.profile?.bio}">
                <div class="span1"></div>
            </div>
        <div class="controls controls-row">
            <div class="span1"></div>
            <button type="submit" class="span3 btn btn-warning">Create Account</button>
            <div class="span1"></div>
        </div>
    <div class="modal-footer">
        <button class="btn btn-danger" data-dismiss="modal" aria-hidden="true">Cancel
        </button>

        <button class="btn btn-success" type="submit">Register
        </button>
    </div>
</div>
</div>
</g:form><!--End of Form-->
<!--End of Registration Modal Page-->

我对应的控制器是“用户”,我也有一个自定义的“注册”操作。我想要的是当我单击创建帐户按钮时,用户在数据库中注册。有没有办法直接通过模态窗口形式来弥补?

4

0 回答 0