View Single Post
  #2 (permalink)  
Old January 21st, 2004, 12:41 PM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I would change the passText function to:
Code:
function passText(Name, Value)
{
  top.frames['right'].document.yourform[Name].value = Value;
}
then change your button to:
Code:
<INPUT onclick="parent.passAll(this.form);" type=button value=Add!>
and finally add the passAll function to the page with passText function:
Code:
function passAll(Form)
{
  passText("email", Form.user.value);
  passText("teacher", Form.user1.value);
  passText("user", Form.user2.value);
}
Note I renamed the textbox called 'name' to 'teacher'. This is because the expression 'yourform.name' is ambiguous, does it mean the name of the form or the element called 'name'? This can cause problems.

--

Joe
Reply With Quote