这是我的表格,我必须接受电话号码或电子邮件,身份证或护照号码
在js / ajax中检查验证的逻辑是什么?
答案 0 :(得分:0)
public class SFPoc {
public static void main(String[] argv) throws Exception {
String userName = "<someuser>";
String password = "<pwd>";
/*String pushTopicName = "/topic/InvoiceStatementUpdates";*/
String pushTopicName = "/topic/Lead2";
long replayFrom = EmpConnector.REPLAY_FROM_EARLIEST;
String securityToken = "<securityToken>";
BayeuxParameters custom = getBayeuxParamWithSpecifiedAPIVersion("37.0");
BayeuxParameters params = null;
try {
params = login(userName, password + securityToken, custom);
} catch (Exception e) {
e.printStackTrace();
}
Consumer<Map<String, Object>> consumer = event -> System.out.println(String.format("Received:\n%s", event));
EmpConnector connector = new EmpConnector(params);
connector.start().get(10, TimeUnit.SECONDS);
TopicSubscription subscription = connector.subscribe(pushTopicName, replayFrom, consumer).get(10, TimeUnit.SECONDS);
System.out.println(String.format("Subscribed: %s", subscription));
}
private static BayeuxParameters getBayeuxParamWithSpecifiedAPIVersion(String apiVersion) {
BayeuxParameters params = new BayeuxParameters() {
@Override
public String version() {
return apiVersion;
}
@Override
public String bearerToken() {
return null;
}
};
return params;
}
}
点击一个条件进行验证请查看我的代码段以获取更多信息。
btnsubmit
$(".btnsubmit").on("click",function(){
if($(".email").val() == "" && ($(".phone").val() == "" || $(".southafricanid").val() == "") && ($(".passport").val() == "" || $(".birthdate").val() == ""))
{
alert();
}
})