调用Telerik按钮中的jQuery代码
我有一个jQuery,它创建一个提示框,以*的形式获取密码。这是我的代码:调用Telerik按钮中的jQuery代码,jquery,jquery-ui,button,telerik,Jquery,Jquery Ui,Button,Telerik,我有一个jQuery,它创建一个提示框,以*的形式获取密码。这是我的代码: $(function () { password = $("#password"), allFields = $([]).add(password), tips = $(".validateTips"); function updateTips(t) { tips .text(t) .addClass("ui-state-highlight"); setTimeou
$(function () {
password = $("#password"),
allFields = $([]).add(password),
tips = $(".validateTips");
function updateTips(t) {
tips
.text(t)
.addClass("ui-state-highlight");
setTimeout(function () {
tips.removeClass("ui-state-highlight", 1500);
}, 500);
}
function checkLength(o, n, min, max) {
if (o.val().length > max || o.val().length < min) {
o.addClass("ui-state-error");
updateTips("Length of " + n + " must be between " + min + " and " + max + ".");
return false;
} else {
return true;
}
}
function checkRegexp(o, regexp, n) {
if (!(regexp.test(o.val()))) {
o.addClass("ui-state-error");
updateTips(n);
return false;
} else {
return true;
}
}
$("#dialog-form").dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Enter": function () {
var bValid = true;
allFields.removeClass("ui-state-error");
bValid = bValid && checkLength(password, "password", 5, 16);
// From jquery.validate.js (by joern), contributed by Scott Gonzalez:
// http://projects.scottsplayground.com/email_address_validation/
bValid = bValid && checkRegexp(password, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9");
if (password.val() != "1234") {
return false;
}
if (password.val() == "1234") {
window.location.href = './Frm_Device.aspx';
alert("1234 ast");
if (bValid) {
$("#users tbody").append("<tr>" +
"<td>" + name.val() + "</td>" +
"<td>" + email.val() + "</td>" +
"<td>" + password.val() + "</td>" + "</tr>");
$(this).dialog("close");
return true;
}
}
},
Exit: function () {
$(this).dialog("close");
}
},
close: function () {
allFields.val("").removeClass("ui-state-error");
}
});
$("#create").button().click(function () {
$("#dialog-form").dialog("open");
return false;
});
});
$(函数(){
密码=$(“#密码”),
所有字段=$([])。添加(密码),
提示=$(“.validateips”);
函数更新(t){
提示
.文本(t)
.addClass(“ui状态突出显示”);
setTimeout(函数(){
removeClass(“ui状态突出显示”,1500);
}, 500);
}
函数校验长度(o、n、最小值、最大值){
如果(o.val().length>max | | o.val().length
我有一个遥控按钮。我想知道如何在这个按钮中调用jQuery
<telerik:RadButton ID="create" runat="server" Text="RadButton"
AutoPostBack="False" ToolTip="combined data recovered from the Teams"
class="create" OnClientClicked="?">
</telerik:RadButton>
在上面的代码中,我应该放置什么,而不是?OnClientClicked使用将要执行的JavaScript函数的名称。这意味着您需要一个命名函数,在其中您可以执行代码。有关如何处理客户端处理程序的更多信息,请参见: 和 在这里
请修复代码的缩进,使其可读。