现在的位置: 首页 > 综合 > 正文

struts1+js 实现注册一个用户时 此用户名是否存在

2013年11月26日 ⁄ 综合 ⁄ 共 614字 ⁄ 字号 评论关闭

onClick时 调用 js方法--

<td width="20%"><img src="image/checkuser.gif" onClick="checkuser()"></td>

 

function checkuser()
{
    var usname=document.all.username.value;
      URL="/项目名称/validateAction.do?method=validateUser&username="+usname;
      loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
      loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
      window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:145px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}

struts-config.xml中

 <forward name="findfailed" path="/checkusersuccess.jsp" redirect="false
" />

【上篇】
【下篇】

抱歉!评论已关闭.