【发布时间】:2018-03-03 11:04:57
【问题描述】:
我正在使用语义 UI。我在表格上填写了手机号码。验证在移动领域不起作用。我必须显示验证消息“输入有效的手机号码”。
我知道使用 Jquery 验证,但我必须使用语义 UI。
谁能帮我解决这个问题?
你能帮我解决这个问题吗?
$('.ui.form').form({
mobileno: {
identifier : 'mobileno',
rules: [
{
type : 'empty',
prompt : 'Enter your mobile number'
},{
type : 'minLength[10]',
prompt : 'Please enter the valid mobile number'
}
]
}
});
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://oss.maxcdn.com/semantic-ui/2.1.4/semantic.min.css">
<form action="process.php" method="post" class="ui form segment">
<div class="field">
<div class="ui input">
<input type="text" placeholder="Contact number" name="mobileno">
</div>
</div>
<input class="ui black submit button" type="submit" name="submit" value="Submit"/>
</form>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="http://oss.maxcdn.com/semantic-ui/2.1.4/semantic.min.js"></script>
【问题讨论】:
-
谁能帮我解决这个问题?
标签: javascript jquery html semantic-ui phone-number