各位高手们,我想在a页制作一个录入窗口,录完之后点提交按钮会在B页面一列表显示,并且有选择框,选中的某行,还能实行删除操作,各位大侠,小弟的这一设想该如何实现呢?
解决方案 »
- 把值返回给select··
- 刚学javaScript,请教一个整蛊人的问题
- 当鼠标划过一个图片时候 这个图片的id值就改变 怎么写?着急
- JS 兼容火狐 的问题 IE 里面已经实现需要兼容火狐
- 在table中的控件一些属性如何读出,
- checkbox选中与不选中后的显示问题
- 在页面给grid的td定义一个样式#grid td{color:red}跟在js脚本里面修改td样式的效率是不是一样的?
- js怎么判断div下的内容全部加载完毕
- 小弟对Javascript不太熟悉,问题很简单,来拿分吧!
- 有没有办法实现在web中通过一个连接打开windows的记事本(回答的立刻给分)
- 如何将一个层的操作结果显示在另一个层中?
- 两个TextArea输入文本后高度同步问题
dialogArguments可以方法父页面的对象,帮你顶。
再在B页面取值应该就可以了。
如果能用数据库的话,可以先保存,在现实页查询再显示就行了
window.parent.document.getElementById("tt").value = document.getElementById("t1").value;
tt是父页面中的id,
t1是子页面中的id.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function LoadWindow2()
{
URL="b.html";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX+100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
//window.open(URL,"read_notify","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=150,resizable=yes");
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
</script>
</head>
<body style="text-align:center;">
<input id="Button1" type="button" value="button" onclick="LoadWindow2()" />
<input id="Text1" type="text" />
</body>
</html>b.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script language="javascript" type="text/javascript">
// <!CDATA[
var parent_window = parent.dialogArguments;
//function Button1_onclick() {
// parent_window.document.getElementById("Text1").value=parent_window.document.getElementById("Text1").value+'好啊! ';
//}function click_user(user_id)
{
TO_VAL=parent_window.document.getElementById("Text1").value;
// targetelement=window.document.getElementsByName(user_id);
// user_name=targetelement.name;
if(TO_VAL.indexOf(","+user_id+",")>0 || TO_VAL.indexOf(user_id+",")==0)
{
if(TO_VAL.indexOf(user_id+",")==0)
{
//parent_window.form1.TO_ID.value=parent_window.form1.TO_ID.value.replace(user_id+",","");
parent_window.document.getElementById("Text1").value=parent_window.document.getElementById("Text1").value.replace(user_id+",","");
// borderize_off(targetelement);
}
if(TO_VAL.indexOf(","+user_id+",")>0)
{
//parent_window.form1.TO_ID.value=parent_window.form1.TO_ID.value.replace(","+user_id+",",",");
parent_window.document.getElementById("Text1").value=parent_window.document.getElementById("Text1").value.replace(","+user_id+",",",");
// borderize_off(targetelement);
}
}
else
{
//parent_window.form1.TO_ID.value+=user_id+",";
parent_window.document.getElementById("Text1").value+=user_id+",";
// borderize_on(targetelement);
}}//function borderize_on(targetelement)
//{
// color="#003FBF";
// targetelement.style.borderColor="black";
// targetelement.style.backgroundColor=color;
// targetelement.style.color="white";
// targetelement.style.fontWeight="bold";
//}//function borderize_off(targetelement)
//{
// targetelement.style.backgroundColor="";
// targetelement.style.borderColor="";
// targetelement.style.color="";
// targetelement.style.fontWeight="";
//}// ]]>
</script>
</head>
<body style="text-align:center;">
<!-- <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />-->
<table border="1" cellspacing="0" width="100%" class="small" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr class="TableControl">
<td class="menulines" id="furui" name="1" flag="1" align="center" onclick="javascript:click_user('1')" style="cursor:hand">
1 </td>
</tr>
<tr class="TableControl">
<td class="menulines" id="hexiao" name="2" flag="1" align="center" onclick="javascript:click_user('2')" style="cursor:hand">
2 </td>
</tr>
<tr class="TableControl">
<td class="menulines" id="songdemei" name="3" flag="1" align="center" onclick="javascript:click_user('3')" style="cursor:hand">
3 </td>
</tr>
<tr class="TableControl">
<td class="menulines" id="tanyi" name="4" flag="1" align="center" onclick="javascript:click_user('4')" style="cursor:hand">
4 </td>
</tr>
<tr class="TableControl">
<td class="menulines" id="yanbin" name="5" flag="1" align="center" onclick="javascript:click_user('5')" style="cursor:hand">
5 </td>
</tr>
<tr class="TableControl">
<td class="menulines" id="zengzhi" name="6" flag="1" align="center" onclick="javascript:click_user('6')" style="cursor:hand">
6 </td>
</tr> </table>
</body>
</html>