我是这个网站的新手,需要帮助。
我有一些朋友(不再联系)为我制作的代码。我的目标是在代码中添加一些复选框,以便所选项目将显示在整个输出中。 这是我现有的代码。
<!-- the script to read the options and make the code -->
<script>
function makeTemplate(){ var newcode="";
for (i=0; i<document.source.elements.length; i++){
newcode=newcode+document.source.elements[i].value;
}
document.getElementById('outputview').innerHTML=newcode;
document.getElementById('outcode').value=newcode;
}
</script>
<!-- end of script -->
<!--
Notice that quotes inside descriptive elements are not allowed.
Use the 7-character code "&rdquo;" instead in the option list values.
-->
<form name="source" id="source" >
<!-- only elements inside this form are added -->
<select style="width:300px;" >
<option value=""> NA</option>
<option value="This is corporate surplus in good condition." > good condition </option>
<option value="This is corporate surplus in good working condition." > good working condition </option>
<option value="This is corporate surplus in great condition." > great condition </option>
<option value="This is corporate surplus in excellent condition." > excellent condition </option>
<option value="This is corporate surplus in excellent working condition." > excellent working condition </option>
<option value="This is corporate surplus in new in box NIB condition." > new in box NIB condition </option>
<option value="This is corporate surplus in new in bulk bag NIB condition."> new in bulk bag NIB condition </option>
</select>
CONDITION <br>
<br/>
<input type=text style="width:500px;" value="<br>Unit provides listed voltage as tested by volt meter."><br>
<br/>
<select style="width:300px;" >
<option value=""> NA</option>
<option value="<br><b>Input: </b> 120vac 60hz. w. 2-prong wall" > 2-prong wall </option>
<option value="<br><b>Input: </b> 120vac 60hz. w. 3-prong wall" > 3-prong wall </option>
<option value="<br><b>Input: </b> 120vac 60hz. w. figure 8 infinity. (NOT included)" > figure 8 infinity </option>
<option value="<br><b>Input: </b> 120vac 60hz. w. standard computer D. (NOT included)"> standard computer D </option>
</select>
INPUT USA <br>
<br/>
<select style="width:300px;" >
<option value=""> NA</option>
<option value="<br><b>Input: </b>120-240vac 50-60hz. w 2-prong wall " > 2-prong wall </option>
<option value="<br><b>Input: </b>120-240vac 50-60hz. w 3-prong wall " > 3-prong wall </option>
<option value="<br><b>Input: </b>120-240vac 50-60hz. w figure 8 infinity. (NOT included) "> figure 8 infinity </option>
<option value="<br><b>Input: </b>120-240vac 50-60hz. w standard computer D. (NOT included) "> standard computer D </option>
</select>
INPUT UNIVERSAL <br>
<br/>
<select style="width:300px;" >
<option value=""> NA</option>
<option value="<br><b>Output: </b> vac a. ma. tip is AC. 3/16” / 5.5mm barrel plug."> 3/16" / 5.5mm barrel plug< /option>
<option value="<br><b>Output: </b> vac a. ma. tip is AC. Proprietary. " > Proprietary </option>
</select>
OUTPUT AC <br>
<br/>
<select style="width:300px;" >
<option value=""> NA</option>
<option value="<br><b>Output: </b> vdc a. ma. tip is +. 3/16” / 5.5mm barrel plug. "> +. 3/16" / 5.5mm barrel plug </option>
<option value="<br><b>Output: </b> vdc a. ma. tip is -. 3/16” / 5.5mm barrel plug. "> -. 3/16" / 5.5mm barrel plug </option>
<option value="<br><b>Output: </b> vdc a. ma. tip is Proprietary. ">Proprietary</option>
</select>
OUTPUT DC <br>
<br/>
<textarea style="width:500px; height:200px;">
<br>
Please double check your volt, current and connector requirements. <br>
On a side note, if you do match all three but
the form factor (what it looks like) is different,
this may still work for you.<br>
<b>Manufactured by: </b> <br>
<b>Web research: </b> <br>
</textarea>
<!-- end of included elements -->
</form>
<br><input type=submit value="MAKE" onclick="makeTemplate()">
<!-- preview area -->
<div id="outputview"><br/><br/>Clicking MAKE will show final output **HERE** based on the code below.<br/></div><br>
<br/><br/>Output code<br/>
<textarea style="width:500px; height:200px;" id="outcode"></textarea>
<br/><br/>
所以,我想做的是在代码中添加一些复选框,如果在表单上检查,它们将显示在页面底部的输出中。像这样...
(复选框)一些文字
(复选框)其他一些文字
(复选框)第三个选项
所以,如果我检查第一个和第三个复选框,&#34;一些文字&#34;和#34;第三种选择&#34;将显示在屏幕底部的两个输出中,但不显示在中间的一些&#34;其他一些文本&#34;
我希望这是有道理的。