PDA

View Full Version : Elements Don't Appear?...Any Ideas?



tedteeter
01-03-2014, 06:20 PM
Greetings, Jan 3rd, 2013

Briefly, on numerous occasions I have loaded a form via a button click with the onclick event that calls a function which loads the form, sets a div's css visibility state and upon observing the form the div is not visible until a second button click. I have encountered this issue in many situations on different projects and it appears as if the div element needs to be changed from null to zero or empty to establish the element! to work around the situation I usually change the null to zero or empty..It isn't a index issue?...any ideas?

Appreciatively,
Ted

djr33
01-03-2014, 06:23 PM
It's a little hard to imagine this abstractly or to know for certain whether it's the same problem each time. Can you provide a link?

tedteeter
01-03-2014, 06:53 PM
djr33,
Thanks for the response so quickly! there is a lot of code and I wouldn't want to bother you with it, however, the situation continually occurs. Click the button the form, div window pops up and a inner div which is a tab doesn't appear until a second button click on the parent form. Once the div window has been loaded the problem never occurs until the div has been closed and the button is clicked to again load the div window and the inner div doesn't appear until a second button click...

Appreciatively,
Ted

djr33
01-03-2014, 07:00 PM
I just don't really know what you're talking about. Is there a reason you can't provide a link to the page?

tedteeter
01-03-2014, 07:38 PM
djr33,
Actually I am using php on my system an not online, works great! Anyways I have provided the routine below perhaps you can see an error?


function loadtechchats(d,dbiz,dclient,demail,dissue,dasstech,dtextfield){
docstate=parent.document.getElementById('popuptechwindow').style.visibility;
if(docstate==null){
docstate.length=0;
}
if(docstate.length==0||docstate=='hidden'){
if(d.id=='techchat'){
width="780";
height="350";
thetechid=document.getElementById('technamepermanent').innerHTML;
pagephpload='techwindows.php?'+'dbname='+dbiz+'&dcname'+dclient+'&demail='+demail+'&dissue='+dissue+'&dtech='+thetechid+'&dquestion='+dtextfield;//+'&dtechid'+thetechid;
parent.document.getElementById('adminpanelpop').innerHTML = '<iframe id=mainiframe1 frameborder=0 width='+width+' height='+height+' scrolling='+scrll+' src=\''+pagephpload+'\'></iframe>';
parent.document.getElementById('popuptechwindow').style.visibility='visible';
}

// reference to iframe with id 'ifrm'
var ifrm = parent.document.getElementById('mainiframe1');
//alert(ifrm);
// reference to window in the iframe
var win = ifrm.contentWindow;
// reference to document in iframe
var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document;

for(i = 1; i < 9; i++){
//alert(doc.getElementById('clientid1').innerHTML);
if(doc.getElementById('clientid'+i).innerHTML==''||doc.getElementById('clientid'+i).innerHTML==null){
//load the image file to represent the chat is loaded..._SESSION
doc.getElementById('clientid'+i).innerHTML=dclient;
doc.getElementById('busnameclientid'+i).innerHTML=dbiz;
doc.getElementById('clientid'+i).style.backgroundImage = "url('./remake/manillagotfocus.gif')";
doc.getElementById('clientid'+i).style.color='#C11A1A';
doc.getElementById('busnameclientid'+i).style.color='#C11A1A';//techid
doc.getElementById('clientid'+i).style.visibility='visible';
i=9;
}

}
}