Let's say I have two pages.
Page1 and Page2.
Page2 is opened by Page1.
Page1 has a text box on it called 'phone'.
<input type=text id=phone>
On Page1 I can refer to this textbox as:
phone.value = whatever
On Page2 I try to reference the textbox on page1 by saying:
opener.document.phone.value = whatever
I get an error message - "opener.document.phone is null or not an object".
If I put form tags around the text box:
<form name=ContactForm>
<input type=text name=phone>
</form>
I can refer to it successfully on Page2 as:
opener.document.ContactForm.phone.value = whatever.
My question is:
why can I refer to the text box phone on page1 when it is not on a form - but cannot reference it from page2?
Page1 and Page2.
Page2 is opened by Page1.
Page1 has a text box on it called 'phone'.
<input type=text id=phone>
On Page1 I can refer to this textbox as:
phone.value = whatever
On Page2 I try to reference the textbox on page1 by saying:
opener.document.phone.value = whatever
I get an error message - "opener.document.phone is null or not an object".
If I put form tags around the text box:
<form name=ContactForm>
<input type=text name=phone>
</form>
I can refer to it successfully on Page2 as:
opener.document.ContactForm.phone.value = whatever.
My question is:
why can I refer to the text box phone on page1 when it is not on a form - but cannot reference it from page2?