- 論壇徽章:
- 1
|
我不會javaScripts。。
我用一段perl代碼提交表格,但是出錯,提示說這里的變量沒有給出。。我懷疑是我看不懂這個onClick事件的函數(shù)引起的,求解:我該傳遞什么樣的參數(shù)給PDB_format.
這段HTML是這個onclick函數(shù)應用的地方之一,我以為這里PDB_format的值是PDBfile或者PDBIDnumber。
但是事實上會返回說PDB_format沒有被選擇。
可能問題描述不夠清晰,歡迎任何拍磚,十分感謝。
<tr>
<td width="250" bgcolor="#CCCCCC" class="styledarkblue24">Choose PDB format </td>
<td width="160" bgcolor="#CCCCCC" class="styledarkblue18"><input name="PDB_format" type="radio" value="PDBfile" onClick="changeMultiCols('text1','' ,'text2', '');">PDB File</td>
<td width="300" bgcolor="#CCCCCC" class="stylegrey18" ID="text1" div label align:"top">Upload PBD file:<input type="file" name="PDB_file" size=30></label></div>
</tr>
<tr>
<td width="250" bgcolor="#CCCCCC"></td>
<td width="160" bgcolor="#CCCCCC" class="styledarkblue18"><input name="PDB_format" type="radio" value="PDBIDnumber" onClick="changeMultiCols('text2','','text1',''); ">PDB ID</td>
<td width="300" bgcolor="#CCCCCC" class="stylegrey18" ID="text2" div label align:"top">Enter PDB ID number:
<input type="text" name="PDB_IDnumber" maxlength=4 size=30></td>
</tr>
兩個function:
function getObj(name){
if (document.getElementById){
this.obj = document.getElementById(name);
this.style = document.getElementById(name).style;
}
else if (document.all) {
this.obj = document.all[name];
this.style = document.all[name].style;
}
else if (document.layers) {
this.obj = document.layers[name];
this.style = document.layers[name];
}
}
function changeMultiCols(texton1, texton2, textoff1, textoff2){
if (!DHTML) return;
if (texton1 != "") {
var textona = new getObj(texton1);
textona.style.color = '#FF0000';
}
if (texton2 != "") {
var textonb = new getObj(texton2);
textonb.style.color = '#FF0000';
}
if (textoff1 != "") {
var textoffa = new getObj(textoff1);
textoffa.style.color = '#999999';
}
if (textoff2 != "") {
var textoffb = new getObj(textoff2);
textoffb.style.color = '#999999';
}
} |
|