字段标签在输入时不会消失

时间:2017-05-27 08:48:02

标签: html asp.net twitter-bootstrap

我最近开始在这个网站上工作。单击或输入值时,输入字段标签不会消失。即使输入值,标签仍会保留在后台。这是一个使用asp.net和bootstrap开发的网站。

                    <div class="contact-form row">
                        <form runat="server" id="cntct_frm">
                            <ul>
                                <li class="text-field span3">
                                    <label id="name-contact-form">
                                        <span class="mainlabel">Name</span>
                                    </label>
                                    <div class="input-prepend">
                                        <span class="add-on"><i class="icon-user"></i></span>
                                        <input class="required" type="text" name="yit_contact[name]" id="txtName" runat="server" />
                                    </div>
                                    <div class="msg-error">
                                    </div>
                                    <div class="clear">
                                    </div>
                                </li>
                                <li class="text-field span3">
                                    <label id="email-contact-form">
                                        <span class="mainlabel">Email</span>
                                    </label>
                                    <div class="input-prepend">
                                        <span class="add-on"><i class="icon-envelope"></i></span>
                                        <input type="text" name="yit_contact[email]" id="txtEmail" runat="server" class="required email-validate"
                                            value="" />
                                    </div>
                                    <div class="msg-error">
                                    </div>
                                    <div class="clear">
                                    </div>
                                </li>
                                <li class="text-field span3">
                                    <label id="phone-contact-form">
                                        <span class="mainlabel">Phone</span>
                                    </label>
                                    <div class="input-prepend">
                                        <span class="add-on"><i class="icon-phone"></i></span>
                                        <input type="text" name="yit_contact[phone]" maxlength="10" runat="server" id="txtMobile" />
                                    </div>
                                    <div class="msg-error">
                                    </div>
                                    <div class="clear">
                                    </div>
                                </li>
                                <li class="textarea-field span9">
                                    <label id="message-contact-form">
                                        <span class="mainlabel">Message</span>
                                    </label>
                                    <div class="input-prepend">
                                        <span class="add-on"><i class="icon-pencil"></i></span>
                                        <textarea name="yit_contact[message]" id="txtMessage" runat="server"
                                            class="required"></textarea>
                                    </div>
                                    <div class="msg-error">
                                    </div>
                                    <div class="clear">
                                    </div>
                                </li>
                                <li class="submit-button span9">
                                    <input type="text" name="yit_bot" id="yit_bot" />
                                    <input type="hidden" name="yit_action" value="sendmail" id="yit_action" />
                                    <input type="hidden" name="yit_referer" value="pages-contact.html" />
                                    <input type="hidden" name="id_form" value="3" />
                                    <asp:Button ID="Submit" name="yit_sendemail" class="sendmail alignright" runat="server"
                                        Text="Submit" OnClientClick="return validation()" OnClick="Submit_Click"></asp:Button>
                                    <div class="clear">
                                    </div>
                                </li>
                            </ul>
                        </form>
                    </div>

1 个答案:

答案 0 :(得分:0)

删除您展示的第一行div。

<div class="contact-form">
// other codings
</div>

您还没有理解为什么我们使用。请查看http://getbootstrap.com/css/