Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
This may be very simple but just could not find the solution: I have a function called initEditor that runs on pageload that should get the value of as textbox and write it into a frame, the function looks like this:
document.frames('myEditor').tbContentElement.DOM.body.innerHTML = document.frmInsert.txtBody.value; }
Somehow this does not work, but when I add an alert function before, then it works:
alert() document.frames('myEditor').tbContentElement.DOM.body.innerHTML = document.frmInsert.txtBody.value; }
Can anybody explain this to me?
i suggest you completely move over to document.getElementByID("elementID") or document.getElementByName("elementName")
and as long as those elements you are interested in have id's and/or names, you can use them. for example (im not 100% this is right)
for instance, this is how your tags might look, whereever they are:
<input type='text' id='grabThisText'>
and in your onload function, this would be it,
document.getElementByName("leftFrame").innerHTML = document.getElementByID("grabThisText").value
sorry but this didn't solve it I still get the same behavior. Only when I add an alertbox it writes the content of the textbox into the frame.
You could try moving the copy line to the end of the document - see if that has any effect. Either that, or
add a pause or checking routine in somewhere.
Or, just call the frame like this:
Hi Jpjones, the pause just worked fine, thanx