View Full Version : assign a variable to textbox

01-26-2005, 03:19 PM
I need to assign a variable in one frame to a textbox in another when the textbox page opens.

In a frame named "content" I have
<input type="text" name="T122" size="20" style="position: absolute; left: 213; top: 77; height: 15px; width: 380px; font-size: 8pt; text-transform: uppercase; font-weight: bold; text-align: center; border: 1px solid #FFFFFF" tabindex="1">

The variable is parent.content1.jNum
I need to be able to have this textbox's value show the variable when the page opens in its frame....any ideas would be appreciated

01-26-2005, 05:04 PM
try this in frame's head

<script language="JavaScript" type="text/JavaScript">

But I am a little cofused... Where is the variable to be passed? (parent? another frame?)

01-26-2005, 08:06 PM
Thanks for replying KOR,
Perhaps I was unclear...I have a frame called "content" in which a page opens in, that has a text box
(no form associated with this text box -css type page)
This Text box is called T122.
I need this textbox to display the value of jNum when the page is opened in its frame. jNum is a variable in another frame called "content1"
hope this is clearer.

01-27-2005, 09:41 AM
no form associated

Than associate it simply nest the text box inside a form
...your text box

and the code should work

01-27-2005, 12:42 PM
As I understand, jNum is a variable and not an element's name.

onload = function(){
document.forms[0].elements['T122'].value = parent.frames['content1'].jNum;