tfer textfield value between parent and child (post preview-

admin

Administrator
Staff member
hi guys

I've exhausted my usual friends with this problem, so I've arrived at ur doorstep in search of some answers.

The purpose of this script is the same as a 'preview post' we get in forums. Users add text to a textarea then format it using schmick buttons to insert tags.

The function I'm using to set up the preview pop-up is:

(parent textfield in Q'n is ..postContent.content.value)

function launch(newURL, newName, newFeatures, orgName) {
var remote = open(newURL, newName, newFeatures);
if (remote.opener == null)
remote.opener = window;
remote.opener.name = orgName;
return remote;
}

function launchPreview() {
window.open("reply_preview_pop.asp", "PreviewContent", "height=400,width=600,yada yada yada,"contribText");
}

This function is called by the preview button and the preview window opens up fine.

However the problem lies with my being able to insert the text from the parent textfield into some span tags of the child.

I've tried far too many various functions, none seem to work and I'm not sure if Im targeting the opener's textfield ID correctly either.

The POS script in the child window looks like this atm.. it's changed considerably over the last 2 days when I feel like nagging it.

(child target is window(?).insertHere.value)

function display(NewCode) {
document.insertHere.value+=NewCode
}
function tfer() {
AddTxt=window.contribText.postContent.Content.value
display(AddTxt)
}
function start() {
window.focus()
tfer()
}

and it called by an onLoad="start()" in the head tags.

I've ID'd some span tags further down the child page as "insertHere" :-|

The site's using asp/javascript and I wont use cookies to solve this problem, nor session variables [in asp]. Im sure the idea behind this script is sound, I just dont know the syntax.

p.s. innerHTML is out since it's IE specific, I'd prefer a cross browser solution...

thx in advance guys.
 
Back
Top