我的网页填表功能,可否实现?
如支付宝的这个注册地址:
https://www.alipay.com/user/user_register.htm
我想自己做一个网页,里面对应的建立一些TEXT,数据可以通过程序一次写入,然后这个网页上安排一个按纽,点击后,这个网页里TEXT的数据就会传到支付宝注册网页的相应的文本框里了,不知道我的这个想法用页面程序可否实现,或用其他编程语言可否实现,如能实现,改如何去做,请指点,谢谢
[解决办法]
如下,就可以了:
<script>
window.open( "https://www.alipay.com/user/user_register.htm?support=000000&_fmu.u._0.e=aaa@b.com&_fmu.u._0.e=aaa@b.com&_fmu.u._0.q=1234567890-&_fmu.u._0.qu=1234567890-&_fmu.u._0.pa=1234567890-&_fmu.u._0.pay=1234567890-&_fmu.u._0.p=%CE%D2%B0%D6%B0%D6%C2%E8%C2%E8%B5%C4%C3%FB%D7%D6%B8%F7%CA%C7%CA%B2%C3%B4&_fmu.u._0.o=0000&_fmu.u._0.pr=%D5%C5%C8%FD%C0%EE%CB%C4&_fmu.u._0.u=2&_fmu.u._0.f=%C7%EB%CA%E4%C8%EB%C4%FA%B5%C4%B9%AB%CB%BE%C3%FB%B3%C6&_fmu.u._0.r=%D5%C5%CE%E5&_fmu.u._0.ca=%C9%ED%B7%DD%D6%A4&_fmu.u._0.car=123456789012345678&_fmu.u._0.m=13100001234&_fmu.u._0.ph=&_fmu.u._0.c=9881&_fmu.u._0.re=alipay&action=register_action&event_submit_do_register=anything ")
</script>
[解决办法]
function getDetailInfProcess()//提取
{
var i=0;
var j=0;
var theSelectedColName=new Array();
var theSelectedColValue=new Array();
var theColboxs=document.all( "trDetailTitles ").getElementsByTagName( "input ");
var theDetailInf= " ";
for (j=1;j <theColboxs.length;j++)
{
if((theColboxs[j].name.substr(0,7)== "colbox_ ")&&theColboxs[j].checked)
{
theSelectedColName[theSelectedColName.length]=theColboxs[j].name.substr(7,100);
}
}
if (theSelectedColName.length==0) {alert( "您没有选择提取列! ");return false;}
var alltbDetailUsed= document.all( "tbDetailUsed ").rows;
for(var i=0;i <alltbDetailUsed.length-1;i++)
{
if (alltbDetailUsed[i].all( "record_select ").checked)
{
for (j=0;j <theSelectedColName.length;j++)
{
theDetailInf=theDetailInf+alltbDetailUsed[i].all(theSelectedColName[j]).value+ "; ";
}
theDetailInf=theDetailInf+ "\n ";
}
}
document.all( "theDetailInfTextarea ").innerText=theDetailInf;
}
function setDetailInfProcess()//填充
{
var i=0;
var j=0;
var theSelectedColName=new Array();
var theColboxs=document.all( "trDetailTitles ").getElementsByTagName( "input ");
var alltbDetailUsed= document.all( "tbDetailUsed ").rows;
var theDetailInf= " ";
var theColsNum=0;
var theRowsNum=0;
for (j=1;j <theColboxs.length;j++)
{
if((theColboxs[j].name.substr(0,7)== "colbox_ ")&&theColboxs[j].checked)
{
theSelectedColName[theSelectedColName.length]=theColboxs[j].name.substr(7,100);
}
}
if (theSelectedColName.length==0) {alert( "您没有选择填充列! ");return false;}
theColsNum=theSelectedColName.length;
theDetailInf=document.all( "theDetailInfTextarea ").innerText.replace(/\t/g, "; ");
if(theDetailInf.length==0)
{
alert( "没有信息可以填充 ");
return false;
}
var theDetailInfRow=theDetailInf.split( "\n ");
var theDetailInfCell;
theRowsNum=theDetailInfRow.length;
if(theRowsNum> 1000) theRowsNum=1000;
for(i=0;i <theRowsNum;i++)
{
theDetailInfCell=theDetailInfRow[i].split( "; ");
if (theDetailInfCell.length <theColsNum) break;
}
theRowsNum=i;
if(!confirm( "填充行数为 "+theRowsNum+ ";填充列数为 "+theColsNum+ "\n请确认! ")) return false;
k=0;
for(var i=0;(i <alltbDetailUsed.length-1)&&(k <theRowsNum);i++)
{
if (alltbDetailUsed[i].all( "record_select ").checked)
{
theDetailInfCell=theDetailInfRow[k++].split( "; ");
for (j=0;j <theSelectedColName.length;j++)
{
alltbDetailUsed[i].all(theSelectedColName[j]).focus();
alltbDetailUsed[i].all(theSelectedColName[j]).value=theDetailInfCell[j];
alltbDetailUsed[i].all(theSelectedColName[j]).select();
}
}
}
}
function selectDetailProcess(trueOrFalse)//按条件批量选中
{
if (trueOrFalse!=false) trueOrFalse=true;
var i=0;
var j=0;
var theSelectedColName=new Array();
var theSelectedColValue=new Array();
var theColboxs=document.all( "trDetailTitles ").getElementsByTagName( "input ");
var theDetailPrepareTr=document.all( "tbDetailPrepare ").rows[0];
for (j=1;j <theColboxs.length;j++)
{
if((theColboxs[j].name.substr(0,7)== "colbox_ ")&&theColboxs[j].checked)
{
theSelectedColName[theSelectedColName.length]=theColboxs[j].name.substr(7,100);
theSelectedColValue[theSelectedColValue.length]=theDetailPrepareTr.all(theColboxs[j].name.substr(7,100)).value;
}
}
var alltbDetailUsed= document.all( "tbDetailUsed ").rows;
for(var i=0;i <alltbDetailUsed.length-1;i++)
{
var theTrWillBeSelected=true;
for (j=0;j <theSelectedColName.length;j++)
{
if(alltbDetailUsed[i].all(theSelectedColName[j]).value!=theSelectedColValue[j])
{
theTrWillBeSelected=false;break;
}
}
if (theTrWillBeSelected)alltbDetailUsed[i].all( "record_select ").checked=trueOrFalse;
}
}
function keyDownControl(obj)//用于控制明细里的上下键。只控制input
{
if(obj.tagName!= "INPUT "||obj.name== " ") return true;
k=event.keyCode;
if(!(k==38||k==40)) return true;
var theSamenameInputs=document.all(obj.name);
var i=0;
if (theSamenameInputs.length> 1)
{
for (i=0;i <theSamenameInputs.length;i++)
{if(theSamenameInputs[i]==obj)break;}
}
if((i==theSamenameInputs.length-1)&&(k==40))
{
if(document.all( "autoAddDetailCheckbox ")!=null&&document.all( "autoAddDetailCheckbox ").checked)
addDetailProcess(theSamenameInputs.length-2);
}
if((i> 0)&&(k==38))
{
theSamenameInputs[i-1].select();
theSamenameInputs[i-1].focus();
event.returnValue=false;
return false;
}
if((i <theSamenameInputs.length-1)&&(k==40))
{
theSamenameInputs[i+1].select();
theSamenameInputs[i+1].focus();
event.returnValue=false;
return false;
}
}
</script>
[解决办法]
to wangsiyi()
你点击按纽之后,需要加的内容是什么?如果是预先定义好的,那么就可以用obj.value = text来设定。但是你需要填写的内容来源是哪?
[解决办法]
点击本地的页面时,生成一个js语句,
大意是javascript:document.getelementById( "aaa ").value=***;.....void(0);
再copy此js语句。
再打开网络上的页面后,在地址栏上粘贴这句话再回车,它就修改了页面上的相应控件的值
上面那个aaa,是网络页面上的某个文本框的id。
也可以把js写得更好些,比如,得到 '姓名 '的下一列的firstChild,再设置它的值.
意思就是这样,不懂再回复.
分不多,我就不写Demo了.累哦. 嘿嘿...