Modx css 问题未在表单上引入样式

发布于 2024-08-22 12:15:28 字数 3601 浏览 8 评论 0原文

我正在使用 Modx cms 编辑网站。 我正在尝试将联系表单添加到联系页面。我已经在模板中指定的侧边栏中有一个。联系页面表单上的代码指向相同的 div 标签,但它没有获取任何 css。

任何想法为什么会发生这种情况。我需要某种插件吗?

感谢您的帮助 问候 朱迪

<div class="enquiry-form-top">

                <h2>Enquiry Form</h2>

            </div>

           <div class="enquiry-form">

                <form class="enquiry" id="enquiry" action="mailer.php" method="post">

   <fieldset>

       <legend>Enquiry Form</legend>

       <div class="form-field">
    <label for="Name">Name:</label>
    <input type="text" id="Name" name="Name" value="">
       </div>

                        <input type="hidden" name="thankspage" value="thank-you.html">
                        <input type="hidden" name="subject" value="Enquiry Form">

       <div class="form-field">
    <label for="Address"> Address:</label>
    <input type="text" id="Address" name="Address" value="">
                            <input type="text" id="Address2" name="Address2" value="">
                            <input type="text" id="Address3" name="Address3" value="">
       </div>
    <div class="form-field">
    <label for="DOB">DOB:</label>
                            <input id="DOB" type="text" name="DOB" value="" />
       </div>

       <div class="form-field">
    <label for="Total-Fund-Size">Total Fund Size:</label>
    <input id="Total-Fund-Size" type="text" name="Total-Fund-Size" value="" />
       </div>

                        <div class="form-field">
    <label for="Number-Of-Funds">Number Of Funds:</label>
    <input id="Number-Of-Funds" type="text" name="Number-Of-Funds" value="" />
       </div>

                        <div class="form-field">
    <label for="Lump-Sum-Benefit">Has Lump Sum <br/>Benefit Been Taken:</label>
    <ul>
                                <li>Yes <input type="checkbox" name="Lump-Sum-Benefit" id="Lump-Sum-Benefit" value="Yes" /></li>
                                <li>No <input type="checkbox" name="Lump-Sum-Benefit" id="Lump-Sum-Benefit2" value="No" /></li>
                            </ul>
       </div>
                        <div class="form-field">
    <label for="Telephone-Number">Telephone Number:</label>
    <input type="text" id="Telephone-Number" name="Telephone-Number" value="">
       </div>

                        <div class="form-field">
    <label for="Best-Time-To-Contact">Best Time To Contact:</label>
    <input type="text" id="Best-Time-To-Contact" name="Best-Time-To-Contact" value="">
       </div>

                        <div class="form-field">
    <label for="Email">Email:</label>
    <input type="text" id="Email" name="Email" value="">
       </div>

                        <div class="form-field">
                           <img src="CaptchaSecurityImages.php" alt="">
                           <label for="security_code"> Security Code: </label>
                           <input type="text" id="security_code" name="security_code">
                        </div>

       <div class="form-buttons">
    <input type="image" name="Submit" value="Submit" src="images/annuity/submit_button.gif">
       </div>

   </fieldset>

      </form>

I'm editing a site using Modx cms.
I'm trying to add a contact form to the contact page. I already have one in the sidebar specified in a template. The code on the contact page form points to the same div tags, but it isn't picking up any of the css.

any ideas why this is happening. Do I need some kind of plugin?

Thanks for all your help
Regards
Judi

<div class="enquiry-form-top">

                <h2>Enquiry Form</h2>

            </div>

           <div class="enquiry-form">

                <form class="enquiry" id="enquiry" action="mailer.php" method="post">

   <fieldset>

       <legend>Enquiry Form</legend>

       <div class="form-field">
    <label for="Name">Name:</label>
    <input type="text" id="Name" name="Name" value="">
       </div>

                        <input type="hidden" name="thankspage" value="thank-you.html">
                        <input type="hidden" name="subject" value="Enquiry Form">

       <div class="form-field">
    <label for="Address"> Address:</label>
    <input type="text" id="Address" name="Address" value="">
                            <input type="text" id="Address2" name="Address2" value="">
                            <input type="text" id="Address3" name="Address3" value="">
       </div>
    <div class="form-field">
    <label for="DOB">DOB:</label>
                            <input id="DOB" type="text" name="DOB" value="" />
       </div>

       <div class="form-field">
    <label for="Total-Fund-Size">Total Fund Size:</label>
    <input id="Total-Fund-Size" type="text" name="Total-Fund-Size" value="" />
       </div>

                        <div class="form-field">
    <label for="Number-Of-Funds">Number Of Funds:</label>
    <input id="Number-Of-Funds" type="text" name="Number-Of-Funds" value="" />
       </div>

                        <div class="form-field">
    <label for="Lump-Sum-Benefit">Has Lump Sum <br/>Benefit Been Taken:</label>
    <ul>
                                <li>Yes <input type="checkbox" name="Lump-Sum-Benefit" id="Lump-Sum-Benefit" value="Yes" /></li>
                                <li>No <input type="checkbox" name="Lump-Sum-Benefit" id="Lump-Sum-Benefit2" value="No" /></li>
                            </ul>
       </div>
                        <div class="form-field">
    <label for="Telephone-Number">Telephone Number:</label>
    <input type="text" id="Telephone-Number" name="Telephone-Number" value="">
       </div>

                        <div class="form-field">
    <label for="Best-Time-To-Contact">Best Time To Contact:</label>
    <input type="text" id="Best-Time-To-Contact" name="Best-Time-To-Contact" value="">
       </div>

                        <div class="form-field">
    <label for="Email">Email:</label>
    <input type="text" id="Email" name="Email" value="">
       </div>

                        <div class="form-field">
                           <img src="CaptchaSecurityImages.php" alt="">
                           <label for="security_code"> Security Code: </label>
                           <input type="text" id="security_code" name="security_code">
                        </div>

       <div class="form-buttons">
    <input type="image" name="Submit" value="Submit" src="images/annuity/submit_button.gif">
       </div>

   </fieldset>

      </form>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除会话 2024-08-29 12:15:28

我想不出有什么理由会发生这种情况,而且你也不需要任何插件。

一旦页面被渲染,它当然只是 HTML,无论它是在 modx 还是任何其他系统中制作的都没有关系。

您可以使用 Firebug 调查页面并确保样式表正在加载吗?

也许正在工作的表单包含在一个带有类的 div 中,并且所有样式都在样式表中设置如下(即包含 div 的子级)
.enclosurediv .form-field
这可以解释为什么您的表单没有选择样式。

您还应该查看 eform (Packagewiki) 它非常适合简单的联系表单。

There is no reason I can think of for this to happen, and you don't need any plug-ins.

Once the page is rendered it is of course just HTML and it doesn't matter if it was made in modx or any other system.

Can you investigate the page using Firebug and make sure the Stylesheet is loading?

Maybe the form that is working is enclosed in a div with a class and all the styles are set in the style sheet as follows (ie. Children of the containing div)
.enclosingdiv .form-field
That would explain why your form isn't picking up the styles.

Also you should check out eform (Package, wiki) it's great for simple contact forms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文