求教js传递表单数据到弹出子页面的写法
<input name= "username " type= "text " id= "username " size= "20 " />
<script language= "javascript " type= "text/javascript ">
function cts()
{
var uname;
uname = document.form1.username.value;
window.open( 'cts.asp?uname= <%=uname%> ', 'go ', 'scrollbars=no,resizable=no,width=240,height=160,left=450,top=450,screenX=200,screenY=200 ');
}
</script>
<input type= "button " name= "button " onclick= "cts(); " value= "ID是否重复 " />
这样写子页面是弹出来了 可是没有把username里填写的数据传过去
急 在线等
------解决方案--------------------var uname;
uname = document.form1.username.value;
window.open( 'cts.asp?uname= <%=uname%> ', 'go ', 'scrollbars=no,resizable=no,width=240,height=160,left=450,top=450,screenX=200,screenY=200 ');
你写个 <%=uname%> 这个干嘛,有什么用啊
写成这不就着了
window.open( 'cts.asp?uname= '+uname,....);