MasterofProject

2 Baidu 32212355 Baidu_3221235521:45 2015.10.26 questions

HTML, JS question: why my new window can not show the value of the two for statements



Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd <! DOCTYPE HTML public "-//W3C//DTD XHTML 1.0 Transitional//EN" in the >
Xmlns= http://www.w3.org/1999/xhtml "<html" >
<head>
<meta http-equiv= "Content-Type" content= "text/html; charset=gb2312" / >
<title> input page </title>
Language= JavaScript "<script" >

Check function ()
{
A=document.getElementById.Value ("myname") var;
B=document.getElementById.Value ("mysex") var;
C=document.getElementById.Value ("myage") var;
D=document.getElementById.Value ("mytel") var;
E=document.getElementById.Value ("myadd") var;
F=document.getElementById.Value ("imgOne") var;
G=document.getElementById.Value ("hobby") var;
If (a== "||a==null")
{
Alert ("the name of the basic information is not filled! ");
Ff.myname.focus ();
Return;
}
If (b== "||b==null")
{
Alert ("basic information gender not filled! ");
Ff.mysex.focus ();
Return;
}
If (c== "||c==null")
{
Alert ("basic information age is not filled! ");
Ff.myage.focus ();
Return;
}
If (d== "||d==null")
{
Alert ("basic information phone is not filled! ");
Ff.mytel.focus ();
Return;
}
If (e== "||e==null")
{
Alert (basic information address is not filled! ");
Ff.myadd.focus ();
Return;
}
If (f== "||f==null")
{
Alert (basic information photos not filled! ");
Ff.mypic.focus ();
Return;
}
If (g.length<= "1")
{
Alert ("love is too long word! ");
Ff.hobby.focus ();
Return;
}
Newpage else ();

}

Newpage //function ()
//{
*
A=document.getElementById.Value ("myname") var;
B=document.getElementById.Value ("mysex") var;
C=document.getElementById.Value ("myage") var;
D=document.getElementById.Value ("mytel") var;
E=document.getElementById.Value ("myadd") var;
F=url var;
G=document.getElementById.Value ("hobby") var;
DW VaR; txtid var;
Dw=window.document.open ();
Dw=document.write ("<html><head><title> a new window </title>");
Dw=document.write ("typewox='text/css'> <style");
Dw=document.write ("div#ff{width:55%; margin:auto;}");
Dw=document.write ("{background-color:#77baab div#grjl;}");
Dw=document.write ("{height:250px width:70%; div#jbxx; float:left;}");
Dw=document.write ("{height:250px width:5%; div#pic; float:right;}");
Dw=document.write ("{margin-bottom:0 H1; text-align:center;}");
Dw=document.write ("{margin-bottom:0 H2; font-size:18px;}");
Dw=document.write ("</style>");
Dw=document.write ("</head><body>");
Dw=document.write ("id='ff'> <div");
Dw=document.write ("id='grjl'><h1> <div resume </h1></div>");
Dw=document.write ("id='jbxx'><h2> <div basic information </h2>");
Dw=document.write ("id='pic'><img src= <div" +f+ "height='210'></div> width='200'");
Dw=document.write ("Name:" +a+ "/><br / <br");
Dw=document.write ("gender:" +b+ "/><br / <br");
Dw=document.write (age: "+c+" /><br / <br ");
Dw=document.write (address: "+e+" /><br / <br ");
Dw=document.write ("the phone:" +d+ "<br /><br /><br >");
Dw=document.write ("id='edu'><h2> <div education experience </h2>");
Dw=document.write ("<ul>");
For (i=0 i<nub; VaR; i++) {
Txtid=educ[i];
Dw.write ("<li>" +printText (txtid) + "</li>");
};
Dw=document.write ("</ul>");
Dw=document.write ("</div>");
Dw=document.write ("name='jiang'><h2> <div awards </h2>");
Dw=document.write ("<ul>");
For (i=0 i<num; VaR; i++) {
Txtid=hno[i];
Dw.write ("<li>" +printText (txtid) + "</li>");
};

Dw=document.write ("</ul></div>");
Dw=document.write ("<div name='NewHobby'><h2> </h2><br / hobby");
Dw=document.write ("" </div> "+hobby+");
Dw=document.write ("</div></div></body></html>");
DW。文件。();

* / / / }


VaR的核心= 0;
VaR教育=新array();
功能addtext1()
{
要点+ +;
VaR txt =文件。createElement(“输入”);
VaR BR =文件。createElement(“公司”);
txt类型为“文本”;
txt。id =“txt”+ tostring()要点;
[要点] = txt.id教育;
txt占位符=“请输入”;
文件。getElementById(“教育”)。appendChild(BR);
文件。getElementById(“教育”)。appendChild(TXT);
}


VaR数= 0;
VaR HNO =新array();
功能addtext()
{
Num + +;
无功txtt =文件。createElement(“输入”);
VaR BR =文件。createElement(“公司”);
txtt类型为“文本”;
txtt。id =“文本”+数tostring();
[民] = txtt.id HNO;
txtt占位符=“请输入”;
文件。getElementById(“江”)。appendChild(BR);
文件。getElementById(“江”)。appendChild(txtt);
}

功能newpage()
{
创建一个文件。getElementById(“我”)的价值;
var b =文件。getElementById(“mysex”)的价值;
var c =文件。getElementById(“myAge”)的价值;
var a文件。getElementById(“我方电报”)的价值;
var =文件。getElementById(“myadd”)的价值;
=网址;
var g =文件。getElementById(“爱好”)的价值;
VAR VAR txtid数据仓库;
DW =窗口。open()文件;
DW =文档编写(<< <html> <head> <名称>一个新的窗口</名称>”);
DW =文件。写(“<风格typewox =中/ CSS“>”);
DW =文件。写(“div # FF {宽度:55%;保证金:汽车;}”);
DW =文件。写(“div # grjl {背景颜色:# 77baab;}”);
DW =文件。写(“div # jbxx {身高:250px;宽度:70%;浮动:左;}”);
DW =文件。写(“div # PIC {身高:250px;宽度:5%;浮动权;}”);
DW =文件。写(“h1 { margin-bottom: 0;文本对齐:中心;}”);
DW =文件。写(“H2 { margin-bottom: 0;字体大小:18px;}”);
DW =文件。写(“< /样式”);
DW =文件。写(“< > <身体/头>”);
DW =文件。写(“'ff <divid=“>”);
DW =文件。写(“<divid= 'grjl”> <h1>个人简历</h1> < / DIV >”);
DW =文件。写(“<divid=“> 'jbxx <H2>基本信息<H2>”);
DW =文件。写(“<divid= 'pic”> <img src=“+ +”width= '200高度= '210”> < / DIV >”);
DW =文件。写(“姓名:“++”<br /> <br />”);
DW =文件。写(“性别:”+ B +”<br /> <br />”);
DW =文件。写(“年龄:“C++”<br /> <br />”);
DW =文件。写(“住址:“+ +”<br /> <br />”);
DW =文件。写(“电话:“++”<br /> <br /> <br />”);
DW =文件。写(“<divid=“> 'edu <H2>教育经历<H2>”);
DW =文件。写(“<ul>”);
对于(var i = 0;i <要点;i++){
txtid =教育[我];
DW。写(“<li>”+ printtext(txtid)+“</李>”);
};
DW =文件。写(“< / UL >”);
DW =文件。写(“< / DIV >”);
DW =文件。写(“<div的名字= 'jiang”> <H2>奖励奖项<H2>”);
DW =文件。写(“<ul>”);
对于(var i = 0;i <民;i++){
txtid =硝酸[我];
DW。写(“<li>”+ printtext(txtid)+“</李>”);
};

DW =文件。写(“< / UL > < / DIV >”);
DW =文件。写(“<div的名字= 'newhobby”> <H2>爱好特长</H2 > >”);
DW =文档编写(”+爱好+“< / DIV >”);
DW =文件。写(“< / DIV > < / DIV > <体> < / HTML >”);
DW。文件。();

}

无功网址;
功能getfileurl(sourceid){

如果(导航。用户代理。indexOf(“MSIE”)> = 1 &!(导航。用户代理。indexOf(“MSIE 10”)> 0)){
/ /网址=文件。getElementById(sourceid)的价值;
文件。所有。imgone。select();
$(“#预览”)。focus();
url =文件。选择文本。createrange();

} else if(导航。用户代理。indexOf(“火狐”)> 0){ //火狐
url =窗口。URL。createobjecturl(文档。getElementById(sourceid)。文件。项目(0));
} else if(导航。用户代理。indexOf(Chrome)> 0){ //铬
url =窗口。URL。createobjecturl(文档。getElementById(sourceid)。文件。项目(0));
} else if(导航。用户代理。indexOf(“MSIE 10”)> 0){
url =窗口。URL。createobjecturl(文档。getElementById(sourceid)。文件。项目(0));
{ }
url =窗口。URL。createobjecturl(文档。getElementById(sourceid)。文件。项目(0));
}
返回网址;
}
功能preimg(sourceid,targetid){
var url = getfileurl(sourceid);
无功imgpre =文件。getElementById(targetid);
如果(窗口。导航。用户代理。indexOf(“MSIE”)> = 1 &!(导航。用户代理。indexOf(“MSIE 10”)> 0)){
无功picpreview =文件。getElementById(“预览”);
picpreview。过滤器。项目(“dximagetransform。微软。AlphaImageLoader”src=网址);
{ }
imgpre.src =网址;
}

}
< /脚本>
< > > < /基本信息H3 H3
<表名称=“FF”id=“FF”>
<div style=“宽度:400像素;高度:550PX;背景:# 9ff”id=“jbxx”>
<ul>
<li>请输入姓名:</李> <输入类型为“文本”的名字=“我”“我”占位符ID = =“必填项”> </李>
<li>请输入性别:</李> <输入类型为“文本”name=“mysex”id=“mysex”占位符=“必填项”> </李>
<li>请输入年龄:</李> <输入类型为“文本”name=“myAge”id=“myAge”占位符=“必填项”> </李>
<li>请输入电话:</李> <输入类型为“文本”的名字=“我方电报”id=“我方电报”占位符=“必填项”> </李>
<li>请输入住址:</李> <输入类型为“文本”name=“myadd”id=“myadd”占位符=“必填项”> </李>
< / UL >
请输入照片:<输入type=“文件”name=“imgone”id=“imgone“onchange =“preimg(这个ID,'imgpre ');”>
<divid=“预览”宽度:200px;身高:210px;边界:solid 1px黑色;”>
<div align=“右”> <img src=“name =“imgpre”width=“200”height=“210px”对齐=“左”id=“imgpre”style=“显示:块;”/> </ DIV >
< / DIV >
< / DIV >
<人力资源宽度=“1340”大小=“1”/ >
<divid=“edu”>
< > > < /教育经历H3 H3
<跨度类=“style1”>请输入从初中开始至今的教育经历:< /跨度>
< / DIV >
<输入=“按钮”name=“BTN1”值=“动态添加文本框”onclick=“addtext1();”/>
<人力资源宽度=“1340”大小=“1”/ >
<divid=“江”>
< > > < /获奖经历H3 H3
<跨度类=“style1”>请输入你获得的任何奖励:< /跨度>
< / DIV >
<输入=“按钮”name=“BTN2”值为“动态添加文本框”onclick=“addtext();”/>
<人力资源宽度=“1340”大小=“1”/ >
< >:< /爱好特长H3 H3 >
<divid=“调频”>
请输入你的爱好特长,不少于20字:<BR> </BR>那样
<文本ID =“爱好”> < /文本>
<人力资源宽度=“1340”大小=“1”/ >
< / DIV >
<输入名称=“提交”type=“按钮”onclick=“check()值”=“提交”/>
<输入type=“复位”value=“重置”/>
< /形式>
< /主体>
< / HTML >

8个回答

Baidu_32212355
baidu_32212355   2015.10.26 21:48

啊啊啊啊啊为什么没有分段!

Handsome10221
handsome10221   2015.10.26 22:28

代码重新整理下吧,没人看得懂。

U011376884
u011376884   2015.10.27 05:40

代码重新整理下吧,有单行注释都不知道哪些代码被注释了

Dehkyuyhkhhfbnyl
dehkyuyhkhhfbnyl   2015.10.27 05:50

CSDN管理员:发出的问题被无故删除,注册用户提问30次也不送下载分,为什么?我都采纳的

Dltsbydh
dltsbydh   2015.10.27 10:22

把代码整理一下吧,看着头晕

Baidu_32212355
baidu_32212355   2015.10.27 16:30

<!DOCTYPE html PUBLIC“- / / / / W3C DTD XHTML 1过渡/连接”HTTP:/ /两。org / TR / xhtml1 / DTD / xhtml1过渡。DTD”>



输入页 / /按钮检测函数,用于检测输入框是否为空全部不为空调用newpage()函数。 功能check() { 创建一个文件。getElementById(“我”)的价值; var b =文件。getElementById(“mysex”)的价值; var c =文件。getElementById(“myAge”)的价值; var a文件。getElementById(“我方电报”)的价值; var =文件。getElementById(“myadd”)的价值; var =文件。getElementById(“imgone”)的价值; var g =文件。getElementById(“爱好”)的价值; 如果(= =“| | = = null) { 警报(“基本信息姓名未填!”); FF。我的名字。focus(); 返回; } If (b== "||b==null") { Alert ("basic information gender not filled! "); Ff.mysex.focus (); Return; } If (c== "||c==null") { Alert ("basic information age is not filled! "); Ff.myage.focus (); Return; } If (d== "||d==null") { Alert ("basic information phone is not filled! "); Ff.mytel.focus (); Return; } If (e== "||e==null") { Alert (basic information address is not filled! "); Ff.myadd.focus (); Return; } If (f== "||f==null") { Alert (basic information photos not filled! "); Ff.mypic.focus (); Return; } If (g.length<= "1") { Alert ("love is too long word! "); Ff.hobby.focus (); Return; } Newpage else (); } Nub=0 var; Educ= new Array var (); / / add text box function dynamic, each frame dynamically add ID value assigned to the educ array AddText1 function () { Nub++; Txt=document.createElement var ("input"); Br=document.createElement var ("br"); Text "txt.type="; Txt.id= "TXT" +nub.toString (); Educ[nub]=txt.id; Txt.placeholder= "please input"; Document.getElementById ("edu").AppendChild (BR); Document.getElementById ("edu").AppendChild (txt); } / / ibid, assigned to the HNO array Num=0 var; Hno=new Array var (); AddText function () { Num++; Txtt=document.createElement var ("input"); Br=document.createElement var ("br"); Text "txtt.type="; Txtt.id= "text" +num.toString (); Hno[num]=txtt.id; Txtt.placeholder= "please input"; Document.getElementById ("Jiang").AppendChild (BR); Document.getElementById ("Jiang").AppendChild (txtt); } / / open a new window Newpage function () { A=document.getElementById.Value ("myname") var; B=document.getElementById.Value ("mysex") var; C=document.getElementById.Value ("myage") var; D=document.getElementById.Value ("mytel") var; E=document.getElementById.Value ("myadd") var; F=url var; G=document.getElementById.Value ("hobby") var; DW VaR; txtid var; Dw=window.document.open (); Dw=document.write ("<html><head><title> a new window </title>"); Dw=document.write ("typewox='text/css'> <style"); Dw=document.write ("div#ff{width:55%; margin:auto;}"); Dw=document.write ("{background-color:#77baab div#grjl;}"); Dw=document.write ("{height:250px width:70%; div#jbxx; float:left;}"); Dw=document.write ("{height:250px width:5%; div#pic; float:right;}"); Dw=document.write ("{margin-bottom:0 H1; text-align:center;}"); Dw=document.write ("{margin-bottom:0 H2; font-size:18px;}"); Dw=document.write ("</style>"); Dw=document.write ("</head><body>"); Dw=document.write ("id='ff'> <div"); Dw=document.write ("id='grjl'><h1> <div resume </h1></div>"); Dw=document.write ("id='jbxx'><h2> <div basic information </h2>"); Dw=document.write ("id='pic'><img src= <div" +f+ "height='210'></div> width='200'"); Dw=document.write ("Name:" +a+ "/><br / <br"); Dw=document.write ("gender:" +b+ "/><br / <br"); Dw=document.write (age: "+c+" /><br / <br "); Dw=document.write (address: "+e+" /><br / <br "); Dw=document.write ("the phone:" +d+ "<br /><br /><br >"); Dw=document.write ("id='edu'><h2> <div education experience </h2>"); Dw=document.write ("<ul>"); For (i=0 i<nub; VaR; i++) { Txtid=educ[i]; Dw.write ("<li>" +printText (txtid) + "</li>"); }; / / is here!!! Browser reported that educ did not say the wrong statement. What do I do if I want to call the array value in the input box function dynamically! Dw=document.write ("</ul>"); Dw=document.write ("</div>"); Dw=document.write ("name='jiang'><h2> <div awards </h2>"); Dw=document.write ("<ul>"); For (i=0 i<num; VaR; i++) { Txtid=hno[i]; Dw.write ("<li>" +printText (txtid) + "</li>"); }; / / here the same as above! Dw=document.write ("</ul></div>"); Dw=document.write ("<div name='NewHobby'><h2> </h2><br / hobby"); Dw=document.write ("" </div> "+hobby+"); Dw=document.write ("</div></div></body></html>"); Dw.document.close (); } URL var; This is the local picture function / / add. It should not be related to my problems. GetFileUrl function (sourceId) { If (navigator.userAgent.indexOf ("MSIE") > = 1 & &! (navigator.userAgent.indexOf ("MSIE 10") > 0)) { //url = document.getElementById (sourceId).Value; Document.all.imgOne.select (); $("#preview").Focus () (); Url =.Text () document.selection.createRange; Else} if (navigator.userAgent.indexOf ("Firefox") > 0) {/ / Firefox Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0)); Else} if (navigator.userAgent.indexOf ("Chrome") > 0) {/ / Chrome Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0)); If}else (navigator.userAgent.indexOf ("MSIE 10") > 0) { Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0)); }else{ Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0)); } URL return; } The picture shows the / / add function PreImg function (sourceId, targetId) { URL var = getFileUrl (sourceId); ImgPre var = document.getElementById (targetId); If (window.navigator.userAgent.indexOf ("MSIE") > = 1 & &! (navigator.userAgent.indexOf ("MSIE 10") > 0)) { Picpreview=document.getElementById var ("Preview"); Picpreview.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader") url =.Src; }else{ ImgPre.src = url; } }

essential information

  • Please enter your name:
  • Please enter sex:
  • Please enter the age:
  • Please enter the phone:
  • Please enter your address:
Please enter a photo:

education experience

Please enter the education experience from the beginning of junior high school:

Winning experience

Please enter any rewards you receive:

Hobby specialty:

Please enter your hobbies, not less than 20 words:


Qq_33238150
Qq_33238150 Display the page also put out!
About a month ago Reply
Baidu_32212355
Baidu_32212355 How to stick it out always like this...
2 months ago Reply
Baidu_32212355
Baidu_32212355   16:32 2015.10.27
  1. <! HTML PUBLIC -//W3C//DTD "XHTML DOCTYPE 1 Transitional//EN""Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd > Input page / / button detection function, for the detection of the input box is empty. All not for air conditioning with newpage () function <br> Check function () { A=document.getElementById var (&quot; myname&quot;).Value; B=document.getElementById var (&quot; mysex&quot;).Value; C=document.getElementById var (&quot; myage&quot;).Value; D=document.getElementById var (&quot; mytel&quot;).Value; E=document.getElementById var (&quot; myadd&quot;).Value; F=document.getElementById var (&quot; imgOne&quot;).Value; G=document.getElementById var (&quot; hobby&quot;).Value; If (a==&quot; &quot; ||a==null) { Alert (&quot; basic information name not filled! &quot;); Ff.myname.focus (); Return; } If (b==&quot; &quot; ||b==null) { Alert (&quot; basic information gender is not filled! &quot;); Ff.mysex.focus (); Return; } If (c==&quot; &quot; ||c==null) { Alert (&quot; basic information age is not filled! &quot;); Ff.myage.focus (); Return; } If (d==&quot; &quot; ||d==null) { Alert (&quot; basic information phone is not filled! &quot;); Ff.mytel.focus (); Return; } If (e==&quot; &quot; ||e==null) { Alert (&quot; basic information address is not filled! &quot;); Ff.myadd.focus (); Return; } If (f==&quot; &quot; ||f==null) { Alert (&quot; basic information photos not filled! &quot;); Ff.mypic.focus (); Return; } If (g.length&lt; =&quot; 1&quot;) { Alert (&quot; the number of long words of love is too small! &quot;); Ff.hobby.focus (); Return; } Newpage </li> (); else </ol> <p>}<br><br> Nub=0 <br>; VAR Educ= new Array var (); <br> / / add text box function dynamic, each frame dynamically add ID value assigned to the educ array <br> AddText1 <br> () function {<br> <br>; nub++ Txt=document.createElement var (&quot; input&quot;); <br> Br=document.createElement var (&quot; br&quot;); <br> Txt.type=&quot; text&quot; <br> Txt.id=&quot; txt&quot; +nub.toString (); <br> <br>; educ[nub]=txt.id Txt.placeholder=&quot; please input <br>; &quot Document.getElementById (&quot; edu&quot;).AppendChild (BR); <br> Document.getElementById (&quot; edu&quot;).AppendChild (txt); <br> }</p> <p>// the same as above, assigned to the HNO array <br> Num=0 <br>; VAR Hno=new Array var (); <br><br> AddText <br> () function {<br> <br>; num++ Txtt=document.createElement var (&quot; input&quot;); <br> Br=document.createElement var (&quot; br&quot;); <br> Txtt.type=&quot; text&quot; <br> Txtt.id=&quot; text&quot; +num.toString (); <br> <br>; hno[num]=txtt.id Txtt.placeholder=&quot; please input <br>; &quot Document.getElementById (&quot; jiang&quot;).AppendChild (BR); <br> Document.getElementById (&quot; jiang&quot;).AppendChild (txtt); <br> }<br> / / open a new window <br><br> Newpage <br> () function {<br> A=document.getElementById var (&quot; myname&quot;).Value; <br> B=document.getElementById var (&quot; mysex&quot;).Value; <br> C=document.getElementById var (&quot; myage&quot;).Value; <br> D=document.getElementById var (&quot; mytel&quot;).Value; <br> E=document.getElementById var (&quot; myadd&quot;).Value; <br> F=url <br>; VAR G=document.getElementById var (&quot; hobby&quot;).Value; <br> DW VaR; txtid <br>; VAR Dw=window.document.open (); <br> Dw=document.write (&quot; <html><head><title> a new window </title>&quot;); <br> Dw=document.write (&quot; typewox='text/css'>&quot <style;); <br> Dw=document.write (&quot; div#ff{width:55%; margin:auto;}&quot;); <br> Dw=document.write (&quot; {background-color:#77baab div#grjl;}&quot;); <br> Dw=document.write (&quot; {height:250px div#jbxx; width:70%; float:left;}&quot;); <br> Dw=document.write (&quot; {height:250px div#pic; width:5%; float:right;}&quot;); <br> Dw=document.write (&quot; {margin-bottom:0 H1; text-align:center;}&quot;); <br> Dw=document.write (&quot; {margin-bottom:0 H2; font-size:18px;}&quot;); <br> Dw=document.write (&quot; </style>&quot;); <br> Dw=document.write (&quot; </head><body>&quot;); <br> Dw=document.write (&quot; id='ff'>&quot <div;); <br> Dw=document.write (&quot; id='grjl'><h1> <div </h1></div>&quot;); <br> Dw=document.write (&quot; id='jbxx'><h2> <div basic information </h2>&quot;); <br> Dw=document.write (&quot; id='pic'><img src= +f+ "width='200'" height='210'></div>&quot <div;); <br> Dw=document.write (&quot; Name: &quot; +a+&quot; /><br; />&quot; <br;); <br> Dw=document.write (&quot; sex: &quot; +b+&quot; /><br; />&quot; <br;); <br> Dw=document.write (&quot; age: &quot; +c+&quot; /><br; />&quot; <br;); <br> DW = document.write(&quot;住址:&quot;+ E + &quot;> > &quot;(); DW = document.write(&quot;电话:&quot;+ D + &quot;> > > &quot;(); DW = document.write(&quot;<div ID = '教育' < > > </H2 H2教育经历&quot;(); DW = document.write(&quot;<ul > &quot;(); for(var i = 0;i <笑;I + +(){ 教育txtid = [我];* dw.write(“<利> &quot;(txtid)+ + printtext &quot;李> < / &quot;(); };/就是这里!浏览器报错说educ未声明.如果我想调用动态添加输入框函数中的数组值该怎么做!* DW = document.write(&quot;< / UL > &quot;(); DW = document.write(&quot;<div>/ &quot;(); DW = document.write(&quot;<div name =“江”> > > </H2 H2奖励奖项&quot;(); DW = document.write(&quot;<ul > &quot;(); for(var i = 0;i <民;I + +(){ txtid = HNO [我];* dw.write(“<利> &quot;(txtid)+ + printtext &quot;李> < / &quot;(); };/这里跟上面一样!” > > < ERP编码DW = document.write(&quot;&lt;/ UL &gt;&gt;&gt/div;&quot;); DW = document.write(&quot;<div name =和# 39;newhobby & # 39;&gt;&gt;&gt爱好特长H2/H2;&lt;&lt;&lt;br / &gt;&quot;); DW = document.write(&quot;&quot;+爱好+ &quot;&lt;/ div &gt;&quot;); DW = document.write(&quot;&lt;/ div &gt;&gt;&gt/div;&lt;/身体&gt;&gt;&gt /的HTML;&quot;); dw.document.close(); < < /预/代码> < > }; (VAR(URL; / /这是添加本地图片函数.跟我的问题应该不相关* 功能getfileurl(sourceid){; < < >(ERP代码(如果navigator.useragent.indexof &quot;MSIE &quot;)≥1 &amp;&amp;!(navigator.useragent.indexof(&quot;MSIE 10 &quot;&gt;0))){ / / url = document.getelementbyid(sourceid)。值; document.all.imgone.select(); $(&quot;#预览&quot;.focus()); url = document.selection.createrange .text(); } else if(navigator.useragent.indexof(&quot;Firefox &quot;&gt;0)){ /火狐 url = window.url.createobjecturl(document.getelementbyid(sourceid)。files.item(0)); } else if(navigator.useragent.indexof(&quot;铬&quot;&gt;0)){ /铬 url = window.url.createobjecturl(document.getelementbyid(sourceid)。files.item(0)); } else if(navigator.useragent.indexof(&quot;MSIE 10 &quot;&gt;0)){ url = window.url.createobjecturl(document.getelementbyid(sourceid)。files.item(0)); } else { url = window.url.createobjecturl(document.getelementbyid(sourceid)。files.item(0)); } 返回URL; } < < /预/代码> <P / /将添加的图片显示出函数* 功能preimg(sourceid,targetid(){ var = getfileurl URL(sourceid);* VaR imgpre = document.getelementbyid(targetid);* 如果(window.navigator.useragent.indexof(&quot;MSIE &quot;)≥1 &amp;&amp;!(navigator.useragent.indexof(&quot;MSIE 10 &quot;&gt;(0)){ VaR(picpreview = document.getelementbyid &quot;预览&quot;(); picpreview.filters.item(&quot;dximagetransform.microsoft.alphaimageloader &quot;)=(.src URL; } else { * imgpre.src = URL;* }; < < >预编码 < < /预/代码> < >

    基本信息

    • 请输入姓名:
    • 请输入性别:
    • 请输入年龄:
    • 请输入电话:
    • 请输入住址:
    请输入照片:

    教育经历

    请输入从初中开始至今的教育经历:

    获奖经历

    请输入你获得的任何奖励:

    爱好特长:

    请输入你的爱好特长,不少于20字:


Baidu_32212355
百度_ 32212355   2015.10.27 16:32
<!DOCTYPE html PUBLIC“W3C / / / / / XHTML DTD 1.0过渡“http://www.w3.org / TR / xhtml1 / DTD / xhtml1-transitional.dtd”>
< HTML xmlns =“http://www.w3.org / 1999 / XHTML”>
<公司>
<元HTTP-EQUIV =“高兴高兴型”=“文本/ HTML;charset = GB2312”>
<名称> <名称>输入页
<用脚本语言。
/ / button detection function, for the detection of the input box is empty. All not for air conditioning with newpage () function
Check function ()
{
A=document.getElementById.Value ("myname") var;
B=document.getElementById.Value ("mysex") var;
C=document.getElementById.Value ("myage") var;
D=document.getElementById.Value ("mytel") var;
E=document.getElementById.Value ("myadd") var;
F=document.getElementById.Value ("imgOne") var;
G=document.getElementById.Value ("hobby") var;
If (a== "||a==null")
{
Alert ("the name of the basic information is not filled! ");
Ff.myname.focus ();
Return;
}
If (b== "||b==null")
{
Alert ("basic information gender not filled! ");
Ff.mysex.focus ();
Return;
}
If (c== "||c==null")
{
Alert ("basic information age is not filled! ");
Ff.myage.focus ();
Return;
}
If (d== "||d==null")
{
Alert ("basic information phone is not filled! ");
Ff.mytel.focus ();
Return;
}
If (e== "||e==null")
{
Alert (basic information address is not filled! ");
Ff.myadd.focus ();
Return;
}
If (f== "||f==null")
{
Alert (basic information photos not filled! ");
Ff.mypic.focus ();
Return;
}
If (g.length<= "1")
{
Alert ("love is too long word! ");
Ff.hobby.focus ();
Return;
}
Newpage else ();

}
Nub=0 var;
Educ= new Array var ();
/ / add text box function dynamic, each frame dynamically add ID value assigned to the educ array
AddText1 function ()
{
Nub++;
Txt=document.createElement var ("input");
Br=document.createElement var ("br");
Text "txt.type=";
Txt.id= "TXT" +nub.toString ();
Educ[nub]=txt.id;
Txt.placeholder= "please input";
Document.getElementById ("edu").AppendChild (BR);
Document.getElementById ("edu").AppendChild (txt);
}

/ / ibid, assigned to the HNO array
Num=0 var;
Hno=new Array var ();
AddText function ()
{
Num++;
Txtt=document.createElement var ("input");
Br=document.createElement var ("br");
Text "txtt.type=";
Txtt.id= "text" +num.toString ();
Hno[num]=txtt.id;
Txtt.placeholder= "please input";
Document.getElementById ("Jiang").AppendChild (BR);
Document.getElementById ("Jiang").AppendChild (txtt);
}
/ / open a new window
Newpage function ()
{
A=document.getElementById.Value ("myname") var;
B=document.getElementById.Value ("mysex") var;
C=document.getElementById.Value ("myage") var;
D=document.getElementById.Value ("mytel") var;
E=document.getElementById.Value ("myadd") var;
F=url var;
G=document.getElementById.Value ("hobby") var;
DW VaR; txtid var;
Dw=window.document.open ();
Dw=document.write ("<html><head><title> a new window </title>");
Dw=document.write ("typewox='text/css'> <style");
Dw=document.write ("div#ff{width:55%; margin:auto;}");
Dw=document.write ("{background-color:#77baab div#grjl;}");
Dw=document.write ("{height:250px width:70%; div#jbxx; float:left;}");
Dw=document.write ("{height:250px width:5%; div#pic; float:right;}");
Dw=document.write ("{margin-bottom:0 H1; text-align:center;}");
Dw=document.write ("{margin-bottom:0 H2; font-size:18px;}");
Dw=document.write ("</style>");
Dw=document.write ("</head><body>");
Dw=document.write ("id='ff'> <div");
Dw=document.write ("id='grjl'><h1> <div resume </h1></div>");
Dw=document.write ("id='jbxx'><h2> <div basic information </h2>");
Dw=document.write ("id='pic'><img src= <div" +f+ "height='210'></div> width='200'");
Dw=document.write ("Name:" +a+ "/><br / <br");
Dw=document.write ("gender:" +b+ "/><br / <br");
Dw=document.write (age: "+c+" /><br / <br ");
Dw=document.write (address: "+e+" /><br / <br ");
Dw=document.write ("the phone:" +d+ "<br /><br /><br >");
Dw=document.write ("id='edu'><h2> <div education experience </h2>");
Dw=document.write ("<ul>");
For (i=0 i<nub; VaR; i++) {
Txtid=educ[i];
Dw.write ("<li>" +printText (txtid) + "</li>");
}; / / is here!!! Browser reported that educ did not say the wrong statement. What do I do if I want to call the array value in the input box function dynamically!
Dw=document.write ("</ul>");
Dw=document.write ("</div>");
Dw=document.write ("name='jiang'><h2> <div awards </h2>");
Dw=document.write ("<ul>");
For (i=0 i<num; VaR; i++) {
Txtid=hno[i];
Dw.write ("<li>" +printText (txtid) + "</li>");
}; / / here the same as above!

Dw=document.write ("</ul></div>");
Dw=document.write ("<div name='NewHobby'><h2> </h2><br / hobby");
Dw=document.write ("" </div> "+hobby+");
Dw=document.write ("</div></div></body></html>");
Dw.document.close ();

}

URL var;
This is the local picture function / / add. It should not be related to my problems.
GetFileUrl function (sourceId) {

If (navigator.userAgent.indexOf ("MSIE") > = 1 & &! (navigator.userAgent.indexOf ("MSIE 10") > 0)) {
//url = document.getElementById (sourceId).Value;
Document.all.imgOne.select ();
$("#preview").Focus () ();
Url =.Text () document.selection.createRange;

Else} if (navigator.userAgent.indexOf ("Firefox") > 0) {/ / Firefox
Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0));
Else} if (navigator.userAgent.indexOf ("Chrome") > 0) {/ / Chrome
Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0));
If}else (navigator.userAgent.indexOf ("MSIE 10") > 0) {
Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0));
}else{
Url = window.URL.createObjectURL (document.getElementById (sourceId).Files.item (0));
}
URL return;
}
The picture shows the / / add function
PreImg function (sourceId, targetId) {
URL var = getFileUrl (sourceId);
ImgPre var = document.getElementById (targetId);
If (window.navigator.userAgent.indexOf ("MSIE") > = 1 & &! (navigator.userAgent.indexOf ("MSIE 10") > 0)) {
Picpreview=document.getElementById var ("Preview");
Picpreview.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader") url =.Src;
}else{
ImgPre.src = url;
}

}
</script>
<h3> basic information </h3>
Name= FF "<form" id= "FF" >
Style= <div "width:400px; height:550px; background:#9FF" id= "jbxx" >
<ul>
Please enter the name: <li> </li><input type= "text" name= "myname" id= "myname" placeholder= "required" ></li>
Please enter <li> </li><input type= gender: "text" name= "mysex" id= "mysex" placeholder= "required" ></li>
Please enter the <li> age: </li><input type= "text" name= "myage" id= "myage" placeholder= "required" ></li>
Please enter <li> Tel: </li><input type= "text" name= "mytel" id= "mytel" placeholder= "required" ></li>
Please enter the <li> address: </li><input type= "text" name= "myadd" id= "myadd" placeholder= "required" ></li>
</ul>
Please enter the photo: <input type= "file" name= "imgOne" id= "imgOne" / >
Id= preview "<div" width:200px; height:210px; 1px black border:solid; ">
That align = "right" ><img SRC = "" name = "imgPre" width = "200" height = "210px" align = "left" id = "imgPre" style = "display: block;" /></div>
</div>
</div>
<hr width= "1340" size= "1" / >
Id= edu "<div" >
<h3> education experience </h3>
Class= STYLE1 "<span" > please input from the beginning of the junior high school education experience: </span>
</div>
<input type= "button" name= "BTN1" value= "dynamic text box"
<hr width= "1340" size= "1" / >
Id= Jiang "<div" >
<h3> winning experience </h3>
Class= STYLE1 "<span" > please enter any rewards you get: </span>
</div>
<input type= "button" name= "btn2" value= "dynamic text box"
<hr width= "1340" size= "1" / >
<h3> hobby Specialty: </h3>
Id= FM "<div" >
Please enter your hobbies, not less than 20 words: <br></br>
Id= hobby "<textarea" ></textarea>
<hr width= "1340" size= "1" / >
</div>
<input name= "submit" type= "button" value= "submit" / >
<input type= "reset" value= "reset" / >
</form>
</body>
</html>
Baidu_32212355
Baidu_32212355 Ah ah ah well!
2 months ago Reply
User default icon Csdn
Upload medium...
Upload pictures
illustrate