忍者形式的输入后缀

发布于 2025-02-01 08:32:24 字数 999 浏览 2 评论 0原文

我想在Ninjaforms中进行一个数字字段,我想添加后缀(在我的情况下,这是一个“名称您的价格”,我希望输入号码遵循货币)。我知道我应该使用:: after content 属性,但我不禁实现了这一点。你能帮我吗?

这是输出代码:

<div id="nf-field-108-wrap" class="field-wrap number-wrap" data-field-id="108">
  <div class="nf-field-label">
    <label for="nf-field-108" id="nf-label-field-108" class="">Name your donation <span class="ninja-forms-req-symbol">*</span>
    </label>
  </div>
  <div class="nf-field-element">
    <input id="nf-field-108" name="nf-field-108" aria-invalid="false" aria-describedby="nf-error-108" class="ninja-forms-field nf-element" aria-labelledby="nf-label-field-108" required="" type="number" value="50" min="25" max="" step="5">
  </div>
</div>

,这就是视野的样子:

“在此处输入图像描述”

I've a number field in NinjaForms where I would like to add a suffix (in my case this is a "Name your Price" where I'd like the input number to be followed by currency). I understand I should use an ::after element with content attribute, but I can't help achieving this. Could you help me?

This is the output code:

<div id="nf-field-108-wrap" class="field-wrap number-wrap" data-field-id="108">
  <div class="nf-field-label">
    <label for="nf-field-108" id="nf-label-field-108" class="">Name your donation <span class="ninja-forms-req-symbol">*</span>
    </label>
  </div>
  <div class="nf-field-element">
    <input id="nf-field-108" name="nf-field-108" aria-invalid="false" aria-describedby="nf-error-108" class="ninja-forms-field nf-element" aria-labelledby="nf-label-field-108" required="" type="number" value="50" min="25" max="" step="5">
  </div>
</div>

And this is how to field looks like:

enter image description here

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

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

发布评论

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

评论(1

野生奥特曼 2025-02-08 08:32:24

我想到了这个,并不是我想要的,但如果没有其他想法,我会分享的话,如果有人使用忍者表格也需要相同的话。

这是我的CSS:

#nf-field-108-wrap > div.nf-field-element::after { content:"€" !important;...}
input#nf-field-108 {width: 100px;}

导致这样做:

”在此处输入图像描述”

I came up with this, not exacly what I wanted but in case of no further ideas I'll share if anyone using Ninja Form would need the same.

This is my css:

#nf-field-108-wrap > div.nf-field-element::after { content:"€" !important;...}
input#nf-field-108 {width: 100px;}

resulting in this:

enter image description here

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