I've got a form defined inside a DIV. When the page first loads this DIV is hidden and then when a particular button is clicked, the div (and more importantly the form) is supposed to be shown. But when the button is clicked the div doesn't show up.
This is the code I'm using to try and show the div (it's part of a function that runs with an onclick event from one of my buttons--I've confirmed that function IS running when I click the button):
Thanks! I knew it was probably something simple but I just wasn't picking up on it.
Quote:
Originally Posted by Kravvitz
Why are you using <layer> and <ilayer> elements? Only NS4.x supports them.
An example script that I found on DynamicDrive showed that. That script adds/changes text in this DIV. I think that was to deal with cross-browser compatibility issues.
Well I changed the code as follows and it's still not displaying :
Code:
function upDtLists(itm){
var avaiList = document.f1.IdxAvailable;
var usedList = document.f1.IdxUsed;
var txt2 = itm.name.split("^");
itm.enabled = false;
txt = txt2[1];
//f1.fldSets.options[f1.fldSets.selectedIndex].value;
alert (txt2[0]); // <--When this function runs, I DO see the alert box.document.getElementById("frm").style.display=block;
var j = 0;
var used = txt.split(",");
avaiList.options.length = 0;
usedList.options.length = 0;
for (k = 0; k < buttonList.length; k++){
//buttonList
}
for (k=0;k < fields.length; k++){
j = 0
for (i=0;i < used.length;i++){
if(k==i){
j = 1
usedList.options[usedList.options.length] = new Option(fields[k], k);
}
}
if(j == 0){
avaiList.options[avaiList.options.length] = new Option(fields[k], k);
}
}
}
Code:
<div id="frm" style="display:none"><br>Hello!<br><form name="f1"><table>
<tr><td colspan="3">Click on an item in either field list to see the purpose/meaning of each.</td></tr>
<!-- <tr><td><input type="textarea" name="t1"</td></tr> -->
<tr>
<td valign="top">
<select name=IdxAvailable size="10" onchange="changetext(fldNames[this.options[this.selectedIndex].value])">
<!-- javascript function will build this select list -->
</select>
</td>
<td valign="center">
<input type="button" onclick="addItem()" value=" Add > "><br>
<!-- javascript function will build this select list -->
<input type="button" value="< Remove" onclick="removeItem()">
</td>
<td valign="top">
<select name="IdxUsed" size="9" onchange="changetext(fldNames[this.options[this.selectedIndex].value])"> -->
<!-- javascript function will build this select list -->
</select><br>
<input type="button" value="Move Up" name="MoveUp" onclick="moveUp()"><input type="button" value="MoveDn" name="Move Down" onclick="moveDn()">
</td>
<td> </td>
<td width="500" valign="top">
<ilayer id="d1" width="200" height="200" visibility="hide">
<layer id="d2" width="200" height="200">
<div id="descriptions" align="left">
<!-- javascript function add text here -->
</div>
</layer>
</ilayer>
</td>
</tr>
<tr>
</tr>
</table></form> </div>
Hate to burst your bubble but, single quotes or double quotes are the same thing in this particular situation. Perhaps, back when you had the double quotes, there was another problem(s).
try the function below, i wrote it a while back ago and i've tested it on ie and firefox(works fine)
in your css use the visibility:hidden;
onClick(func_handleDiv('div_id',1));
that should work.....
try the function below, i wrote it a while back ago and i've tested it on ie and firefox(works fine)
in your css use the visibility:hidden;
onClick(func_handleDiv('div_id',1));
that should work.....