我有一个定制的php页面,它有一个注册表单:
php:
<?php require_once __DIR__ . '/../../../vanguard/extra/auth.php';\
$foundUsername = "testUser";
?>
<form role="form" action="https://my.neonn.com.au/register" method="POST" id="registration-form" autocomplete="off">
<input type="hidden" value="<?= csrf_token() ?>" name="_token">
<input type="hidden" name="username" id="username" value="<?php echo $foundUsername; ?>">
<input type="password" class="form-control empty" id="inputPassword" name="password">
<input type="password" class="form-control empty" id="inputPasswordCheck" name="password_confirmation">
<button type="submit">Submit</button>
</form>
我试图显示当密码不符合规则时显示的“部分/消息”错误。例如,包含6个字符。
我尝试过将这些添加到我的代码中。<?= @include('partials/messages') ?>
似乎什么都没有用。
发布于 2018-07-18 14:50:43
我认为你真的需要更多地阅读Laravel文档 - 在这里你似乎有点偏僻,特别是在使用模板/通过控制器将数据传递给你的视图时。我担心如果你对基础知识没有了解,那么你将会遇到很多麻烦。
你应该从这里开始。
但是要回答这个问题:
“..密码不符合规则时显示的错误。例如包含6个字符......”
我假设你要在用户输入数据时执行此操作,而不是在提交实际表单时。如果是这样,可以随时查看表单输入绑定或jquery .keyup函数。
https://stackoverflow.com/questions/-100005593
复制相似问题