提交 5e8d701b 编写于 作者: K kohsuke

value validation


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6419 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3b1d02fa
......@@ -81,10 +81,20 @@
table.removeChild(master);
makeButton("${id}button", function (e) {
<!-- when 'add' is clicked... -->
var name = $$('${id}text').value;
if(name=="") {
alert("Please enter an user name or a group name");
return;
}
if(findElementsBySelector(table,"TR").find(function(n){return n.getAttribute("name")==name;})!=null) {
alert("Entry for '"+name+"' already exists");
return;
}
var copy = document.importNode(master,true);
copy.removeAttribute("id");
copy.removeAttribute("style");
var name = $$('${id}text').value;
copy.firstChild.innerHTML = name;
copy.setAttribute("name",name);
table.appendChild(copy);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册