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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parent.leftframe reference does not work in Mozilla 1.5

Status
Not open for further replies.

djmc

Programmer
Jun 12, 2002
179
CA
Hi. I have a button with an onClick event which assigns a value to a textbox located on a left frame. This code works on IE browsers but on Mozilla it does not execute that command.

this is the function

function addToCart() {
alert("adding to cart");
parent.left.testbox.value="modified by main frame!";
}

it executes the alert but does not change the value of the textbox in the left frame (works in IE though).

Can someone help. Thanks.
 
you may need to add the name of the form like this...

parent.left.myForm.testbox.value="modified by main frame!";

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
But there is no <form> </form> enclosing the text field.. i just i have <input type=&quot;text&quot; name=&quot;testbox&quot; />

so wouldnt a object be created and named testbox?
 
Only in IE. Mozilla, Netscape, and others won't fix your syntax errors. Input fields must be enclosed by <form></form> tags.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top