我尝试找到所有以字符串"matchItem_"开头的id,并为每个id定义一个click事件.onclick我想要用url param执行脚本并更改此id元素中的图像.不幸的是我的语法不对,我也试过.each.function但我没有得到它.
请看我的代码:
$('[id^="matchItem_"]').each {
$(this).click(){
//...execute my script.php?urlparam=xx....;
$(this).find('img').attr('src','/admin/images/ok.png');
}
}
Run Code Online (Sandbox Code Playgroud)
感谢某人的帮助
先生,michbeck
heyho,
我坚持以下问题:我试图阻止用户可以选择字段"用户名"和"电子邮件"相同的值.我正在使用jquery表单验证插件(http://bassistance.de/jquery-plugins/jquery-plugin-validation/)
如果有人能告诉我的方式会很棒,请在这里查看我的代码:
// validate form
$("#signupform").validate({
rules: {
username: {
required: true,
minlength: 2,
remote: "/_misc/formcheck/username.cfm"
},
password1: {
required: true,
minlength: 5
},
password2: {
required: true,
minlength: 5,
equalTo: "#password1"
},
email: {
required: true,
email: true,
remote: "/_misc/formcheck/email.cfm"
},
email2: {
required: true,
email: true,
equalTo: "#email"
},
usage: "required"
},
messages: {
username: {
required: "please username!!",
minlength: "username at least 2 chars"
},
password1: {
required: "please password!",
minlength: "password at least 5 chars" …Run Code Online (Sandbox Code Playgroud) 谁能告诉我如何编写一条规则来验证用户是否选择/填充了一个单选按钮选项和(最佳)文本字段?如果未#myradiogroup选择任何复选框选项且文本字段#email2为空,则规则应仅给出一条消息。
我的表格代码:
<form name="my" id="myForm" action="" method="post">
<input type="radio" name="myradiogroup" id="myradiogroup" value="option 1" /> option 1
<input type="radio" name="myradiogroup" id="myradiogroup" value="option 2" /> option 2
<label for="emailNew4use">this is an optional field:</label>
<input type="text" name="email2" id="email2" />
<input type="submit" value="send">
</form>
Run Code Online (Sandbox Code Playgroud) 忽略某个目录及其中所有子目录中某个文件类型的正确方法是什么?
示例:忽略所有子目录中的所有.xml文件.master/xyz/master/xyz/
我不确定以下哪两种方法是正确的......
master/xyz/*/*.xml
master/xyz/**/*.xml
Run Code Online (Sandbox Code Playgroud)
我应该使用哪一个?
(我使用Git 1.9.1)
请参阅我现在使用的以下 CSS 规则来创建左右带有“箭头效果”的矩形:
CSS:
.hexagon {
position: relative;
width: 60px;
height: 34.64px;
background-color: #64C7CC;
margin: 17.32px 0;
}
.hexagon:before,
.hexagon:after {
content: "";
position: absolute;
width: 0;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
.hexagon:before {
bottom: 100%;
border-bottom: 17.32px solid #64C7CC;
}
.hexagon:after {
top: 100%;
width: 0;
border-top: 17.32px solid #64C7CC;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div class="hexagon"></div>
Run Code Online (Sandbox Code Playgroud)
任何人帮助我可以做什么,当我需要一个矩形width:60px,并height:22px和三角形左/右哪些配合?