我一直面临这个问题。我尝试了很多事情,但没有人奏效。我在此页面上的验证错误始终在左侧可见。这是我的验证引擎 jquery。请帮忙。
$("#register_form").validationEngine({
showOneMessage: true,
scroll : false,
maxErrorsPerField: 1,
promptPosition: "bottomLeft",
updatePromptsPosition: true,
autoPositionUpdate: true,
});
});
HTML 这是我的表格。
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'])?>" method="post" id="register_form">
<div class="col-100">
<input type="text" class=" twidh validate[required, minSize[2]] " maxlength="60" placeholder="Your Name" name="name" id="rname" />
<span id="runame" class="errroes"></span> </div>
<div class="col-100">
<input type="text" class=" twidh validate[required, custom[email]]" maxlength="100" placeholder="Your Email Address" name="remail" id="remail" onblur="validateEmail()" />
<span id="runame" class="errroes"></span> </div>
<div class="col-100">
<input type="password" class=" twidh validate[required, minSize[6]]" placeholder="Your Password" name="password" id="rpassword" />
<span class="errroes" id="rpwd"></span> </div>
<div class="col-100">
<input type="text" class=" twidh validate[required, custom[onlyNumber] ,minSize[10],maxSize[10]]" maxlength="10" maxlength="10" placeholder="Enter Mobile Number" name="mobile" id="phone" />
</div>
<div class="col-100">
<div class="text-hea" id="gender">Gender</div>
<div class="twidh">
<div class="names">
<input type="radio" class="radioo" value="M" id="male" name="sex" /> Male </div>
<div class="names">
<input type="radio" class="radioo" value="F" id="female" name="sex" checked="checked" /> Female
</div>
</div>
</div>
</div>
<div class="link" style="text-align:left !important"> By clicking Register, you agree to <strong>Terms of Use</strong> and <a href="http://www.shopes.in/return-policy.php"><strong>Privacy Policy.</strong></a>
</div>
<div class="col-100">
<div class="col-md-2">
<input type="submit" class="ss1 st" name="register" value="Register Now" />
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
最佳答案
我在您的 website 上找到了您的 HTML 。该问题是由 .link
类上的 position:relative
样式引起的。您已将其应用到表单上方的 OR
block 上。
您可以通过在 form
元素上应用另一个 position:relative
样式来轻松解决此问题。那么就会变成这样:
<form action="/sregister.php" method="post" id="register_form" style="
position: relative;
">
我刚刚在您的实时网站上对此进行了测试,效果非常好。
关于javascript - Jquery验证引擎位置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45518069/