JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 22nd, 2003, 12:18 PM
meth meth is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 8 meth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
tferring textfield value from parent to child

hi guys

I've exhausted my usual mates 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:

Quote:
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..

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


and it called by 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. Im sure the idea behind this script is sound, I just dont know the syntax.

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

thx in advance guys.

Reply With Quote
  #2  
Old January 24th, 2003, 12:45 AM
Nigorr Nigorr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Brisbane, Australia
Posts: 78 Nigorr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Interesting, thanks for indirectly pointing me to this
Web Page Here

So there is a whole world of DOM I didn't know about. I think you will be able to get some ideas out of the above web page.

good luck

Reply With Quote
  #3  
Old January 24th, 2003, 01:49 AM
meth meth is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 8 meth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
innerHTML and outerHTML are more reliable in IE I have varied results in netscape mozilla and others.

I find it a solution only when designing for intranets run on IE.

Still haven't found a solution yet. It's a simple preview of a gad damn text field !!

oh well - perhaps I need to escape the chars b4 their tferred to child window then unescaped....

Last edited by meth : January 24th, 2003 at 01:51 AM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > tferring textfield value from parent to child


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap