Link to home
Start Free TrialLog in
Avatar of boatful
boatful

asked on

onclick send form contents to child window bodyonclick send form contents to child window body

My personalized fitness program generator form (so far) looks like this:

<FORM>
Client's Name<INPUT TYPE="TEXT" NAME="name" SIZE=35>
<P>
<INPUT TYPE="CHECKBOX" NAME="exercise" VALUE="<IMG SRC='ex1.gif'>
<BR>blah,blah (ex1)<HR>">EXERCISE 1<BR>

<INPUT TYPE="CHECKBOX" NAME="exercise" VALUE="<IMG SRC='ex2.gif'>
<BR>blah,blah (ex2)<HR>">EXERCISE 2<BR>

<INPUT TYPE="CHECKBOX" NAME="exercise" VALUE="<IMG SRC='ex3.gif'>
<BR>blah,blah (ex3)<HR>">EXERCISE 3<BR>

ETC,ETC...<P>

<INPUT TYPE="reset" NAME="Reset">
</FORM>

What I need is an onclick button (function) which opens a child window and writes the form field contents ('name' and 'exercise') into the BODY of the popped window.  Please help!!My personalized fitness program generator form (so far) looks like this:

<FORM>
Client's Name<INPUT TYPE="TEXT" NAME="name" SIZE=35>
<P>
<INPUT TYPE="CHECKBOX" NAME="exercise" VALUE="<IMG SRC='ex1.gif'>
<BR>blah,blah (ex1)<HR>">EXERCISE 1<BR>

<INPUT TYPE="CHECKBOX" NAME="exercise" VALUE="<IMG SRC='ex2.gif'>
<BR>blah,blah (ex2)<HR>">EXERCISE 2<BR>

<INPUT TYPE="CHECKBOX" NAME="exercise" VALUE="<IMG SRC='ex3.gif'>
<BR>blah,blah (ex3)<HR>">EXERCISE 3<BR>

ETC,ETC...<P>

<INPUT TYPE="reset" NAME="Reset">
</FORM>

What I need is an onclick button (function) which opens a child window and writes the form field contents ('name' and 'exercise') into the BODY of the popped window.  Please help!!
ASKER CERTIFIED SOLUTION
Avatar of faster
faster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boatful
boatful

ASKER

Thanks, Faster.........
The only concern I have is the 50 or so "if,then" statements I will need........
I wonder, could we replace all the "if (document.form1.exercise1.checked)" statements with a routine such as "for i = 1 to n"
if (document.form1.i.checked)
window1.document.write(document.form1.i.value);

where n is the number of exercises in the menu.

this would shorten the script considerably, I'd think.
Do you care to try??