This is what we'll use for the salutation in any ema-6ren">
gpt4 book ai didi

javascript - jQuery 验证插件多个错误放置

转载 作者:行者123 更新时间:2023-11-28 13:55:48 25 4
gpt4 key购买 nike

请帮助我使用 jQuery 验证插件。可以在自定义位置显示错误消息吗?

<div class="row">
<div class="cell label">
<?php echo $entry_name; ?>
<div> <!-- .cell.label -->
<div class="cell input">
<input type="text" id="Username" name="name" value="" tabindex="1" class="kilo" value="<?php echo $name; ?>">
<div> <!-- .cell.input -->
<div class="cell context">
This is what we'll use for the salutation in any emails we send you.
<?php if ($error_name) { ?>
<span class="error"><?php echo $error_name; ?></span>
<?php } ?>
**<div class="status">i want to display the error message here</div>**
<div> <!-- .cell.context -->
<div> <!-- .row -->

<div class="row">
<div class="cell label">
<?php echo $entry_email; ?>
</div> <!-- .cell.label -->
<div class="cell input">
<input type="text" id="Email" name="email" value="" tabindex="1" class="kilo email">
</div> <!-- .cell.input -->
<div class="cell context">
We won't spam you or share your email. Ever.
**<div class="status">i want to display the error message here</div>**
</div> <!-- .cell.context -->
</div> <!-- .row -->

编辑:可以使用多个 errorLabelContainer 吗?

最佳答案

您可以使用 errorLabelContainer ...请参阅此处的文档 --> http://docs.jquery.com/Plugins/Validation/validate#toptions

errorLabelContainer:“#messageBox1”

其中 #messageBox1 是您希望显示消息的 div 的 id

关于javascript - jQuery 验证插件多个错误放置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8030290/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com