Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript problem

Status
Not open for further replies.

raha

Programmer
Jan 9, 2001
11
US
Can anyone please tell me why this javascipt doesn't work in Netscape6 and what should I do to make it work?

var pTop = eval('parent.document.FORM104TOP.RC104TOP');

 
i dont think you need the document in there.


var pTop = eval('parent.FORM104TOP.RC104TOP');

should work
adam@aauser.com
 
what about it doesn't work? is it returning an error of some sort? jared@aauser.com
 
luciddream, Thanks for replying but that doesn't work either.

jaredn, I say it doesn't work because when I put an
alert statement after assigning, nothing is displayed.

I have:

var pframe = eval('parent.FRAMEP1.document');
alert(pframe);
var pTop = eval('parent.FORM104TOP.RC104TOP');
alert(pTop);

When it passes through the first alert, it gives me aa alert message [object HTMLDOCUMENT]. But it does not give any alert message for the second alert statement.

Can anyone help me figure out this one?
 
you may want to check for errors in NS6 by going to:

tasks-->tools-->javascript prompt

see if there is an error there jared@aauser.com
 
jaredn:

I did that and the error it gives is parent.FORM104TOP has no properties. This is how I have in my .html:

<SCRIPT LANGUAGE=&quot;JavaScript&quot; SRC=&quot;P1.JS&quot;>
</SCRIPT>
<FRAMESET COLS=&quot;100%,*&quot; FRAMEBORDER=0 >
<FRAME NAME=FRAMEP1 SRC=&quot;P1_104.html&quot; SCROLLING=AUTO FRAMEBORDER=1>
</FRAMESET>
<FORM NAME=FORM104TOP METHOD=POST ACTION=&quot;p11.jsp&quot; TARGET=_self>
<INPUT TYPE=HIDDEN NAME=RC104TOP VALUE=&quot;TOP&quot;>
<INPUT TYPE=HIDDEN NAME=RC104NAME VALUE=&quot;P1&quot;>
</FORM>
</HTML>

Do you see anything wrong in my .html?
 
try this:
var pTop = eval('document.FORM104TOP.RC104TOP');
ray
rheindl@bju.edu

 
ray: I tried that and it doesn't work either. Any other suggestions?

 
you probably should take the form out of the frameset. Why dont you put it inside a hidden frame? i think that would fix your problems.... jared@aauser.com
 
jaredn: in my .html file, form is outside of the frameset.
Could you tell me how do I put it in a hidden frame?
Thanks for your help..

<SCRIPT LANGUAGE=&quot;JavaScript&quot; SRC=&quot;P1.JS&quot;>
</SCRIPT>
<FRAMESET COLS=&quot;100%,*&quot; FRAMEBORDER=0 >
<FRAME NAME=FRAMEP1 SRC=&quot;P1_104.html&quot; SCROLLING=AUTO FRAMEBORDER=1>
</FRAMESET>
<FORM NAME=FORM104TOP METHOD=POST ACTION=&quot;p11.jsp&quot; TARGET=_self>
<INPUT TYPE=HIDDEN NAME=RC104TOP VALUE=&quot;TOP&quot;>
<INPUT TYPE=HIDDEN NAME=RC104NAME VALUE=&quot;P1&quot;>
</FORM>
</HTML>

 
I had it like that and it worked fine in Netscape4 but now it doesn't work in Netscape6. Does anybody know what can be done to make this work? Thanks for your help!
 
to make a hidden frame just add another frame tag, and make it have 0 rows/columns jared@aauser.com
 
it's not a reference if it worked in ns4 : it allows anything
in the BODY of a frameset page only the <frameset>...</frameset> part (and maybe the <noframe>...</noframe>) is read, any other tag are irrelevant and it's normal they are not displayed/known in a correct browser
jaredn's solution is the proper way
 
Jaredn: Thanks for your suggestion. I changed my .html to

<FRAME NAME=FRAMEP1 SRC=&quot;P1_104.html&quot; SCROLLING=AUTO FRAMEBORDER=1>
<FRAME NAME=FRAMEDUMMY SRC=&quot;P1_DUMMY.html&quot; SCROLLING=NO FRAMEBORDER=0>

and the P1_DUMMY.html has the following:

<FORM NAME=FORM104TOP METHOD=POST ACTION=&quot;p11.jsp&quot; TARGET=_self>
<INPUT TYPE=HIDDEN NAME=RC104TOP VALUE=&quot;TOP&quot;>
<INPUT TYPE=HIDDEN NAME=RC104NAME VALUE=&quot;P1&quot;>
</FORM>

The above worked fine. But I am seeing other problems. To solve those, I will have to load P1_DUMMY.html first and then P1_104.html. This is not happening right now.
Could you tell me if I could do that and if so how?
Thankyou so much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top