...

View Full Version : what am i doing wrong with this getelement script



howardfan123
01-18-2009, 03:23 PM
i cant figure out what i am doing wrong this worked with tables but not text boxes
Here is what i am trying to do
I have a bunch of text boxes on a part of a page and trying to get them to copy into two index size cards with text boxes on another part of the page
then just print out the card only
here is what i have so far (copy from the red to the blue and green)



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
function copyValue(el) {
document.getElementById('copy_' + el.id).innerHTML = el.value;
document.getElementById('copy2_' + el.id).innerHTML = el.value;
}
</script>

<style type="text/css">
#Layer1 {
position:absolute;
width:409px;
height:139px;
z-index:1;
left: 141px;
top: 211px;
}
#Layer2 {
position:absolute;
width:133px;
height:130px;
z-index:2;
top: 15px;
left: 383px;
visibility: visible;
}
#Layer3 {
position:absolute;
width:332px;
height:241px;
z-index:4;
left: 0px;
top: 0px;
visibility: visible;
}
.style4 {font: italic bolder 24pt "Script MT Bold"; color: #0033FF; font-size: 28pt; }
.MASTERLABELS {
font: bold 12pt "Comic Sans MS";}
.MASTERLABELS6 {
font: italic bold 12pt "Comic Sans MS";
color: #0000CC;
text-decoration: underline;}
.INPUTTEDINFO {
font: 12pt "MS Reference Sans Serif";}
.style15 {font: italic bolder 24pt "Script MT Bold"; color: #0033FF; font-size: 14pt; }
.style19 {font-size: 18pt}
.style23 {
font-size: 18pt;
font-family: "Script MT Bold";
color: #0033FF;}

#Layer4 {
position:absolute;
width:213px;
height:69px;
z-index:1;
left: 360px;
top: 836px;
visibility: visible;
}
#Layer5 {
position:absolute;
width:564px;
height:400px;
z-index:5;
visibility: visible;
}
#Layer6 {
position:absolute;
width:543px;
height:183px;
z-index:6;
left: 31px;
top: 879px;
}
.style12 {font: 22pt "Script MT Bold"; color: #0033FF; font-weight: bold; font-size: 24pt; }

</style>

</head>


<body>
<p class="MASTERLABELS6">CHOOOSE TYPE OF CARD </p>
<table width="200">
<tr>
<td><label>
<input name="type of card" type="radio" onclick="copyvalue(this):" id="yourinvited" value="Your Invited" >
<span class="MASTERLABELS">YOUR INVITED </span></label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="type of card" value="Join Us" id="joinus"nclick="copyvalue(this):">
<span class="MASTERLABELS">JOIN US </span></label></td>
</tr>
</table>
<p class="MASTERLABELS6">DATE OF EVENT </p>
<p>
<input name="MASTERDATE" type="text" id="masterdate" size="30" onchange="copyValue(this);" /></p>
<p class="MASTERLABELS6">DAY OF EVENT </p>
<p><select name="masterdayofweek" id="masterdayofweek" onchange="copyValue(this);">
<option value="" selected="selected">Choose Day</option>
<option value=" Sunday ">Sunday</option>
<option value=" Monday ">Monday</option>
<option value=" Tuesday ">Tuesday</option>
<option value=" Wednesday ">Wednesday</option>
<option value=" Thursday ">Thursday</option>
<option value=" Friday ">Friday</option>
<option value=" Saturday ">Saturday</option>
</select>
</p>
<p class="MASTERLABELS6">TIME OF EVENT </p>
<p><span class="MASTERLABELS">FROM</span>
<input name="MASTERSTARTTIME" type="text" id="masterstarttime" onchange="copyValue(this);" size="4">
<select name="AMPM1" id="ampm1" onchange="copyValue(this);">
<option value=" AM " selected="selected">AM</option>
<option value=" PM ">PM</option>
</select>
<span class="MASTERLABELS">TO </span>
<input name="MASTERENDTIME" type="text" id="masterendtime" onchange="copyValue(this);" size="4"/>
<select name="AMPM2" id="ampm2" onchange="copyValue(this);">
<option value=" AM " selected="selected">AM</option>
<option value=" PM ">PM</option>
</select>
<p></p>
<span class="MASTERLABELS6">LOCATION OF EVENT</span>
<p><span class="MASTERLABELS">WHERE</span>
&nbsp;
<input name="MASTERADDRESS" type="text" size="30" id="masteraddress" onchange="copyValue(this);copyValue(this)"/>
</p>
<p><span class="MASTERLABELS">CITY</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<input type="text" name="MASTERCITY" id="mastercity" onchange="copyValue(this);"/>
</p>
<p><span class="MASTERLABELS">STATE</span>
&nbsp;
<input name="masterstate" type="text" id="masterstate" size="4" onchange="copyValue(this);"/>
&nbsp; <span class="MASTERLABELS">ZIP CODE </span>
<input name="MASTERZIPCODE" type="text" id="masterzipcode" size="7" onchange="copyValue(this);"/>
</p>


<title>CARD one</title><body>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="candlelogo"><img src="../My Documents/Unnamed Site 5/Picture2.gif" alt="candle logo" width="125" height="125" ></div>
<p>&nbsp;</p>
<div id="yourinvited"><span class="style4">Your Invited</span></div>
<p>&nbsp;</p>
<p><span class="style19">&nbsp;&nbsp;&nbsp; </span><span class="style8">Date:</span>
<span><INPUT name="" type="text" class="date" id="copy_masterdayofweek" size="12" maxlength="12" readonly="true" /></span>
<input name="MASTERDATE" type="text" class="date" id="copy_masterdate" size="18" maxlength="18" readonly="true"/>
</p>
<div id="allyscandle"><img src="../My Documents/Unnamed Site 5/Picture1.gif" alt="allycandlelogo" width="300" height="209" align="top" /></div>
<p><span class="style19">&nbsp;&nbsp;&nbsp;</span><span class="style8"> Time:</span>
<input name="text" type="text" class="date" id="copy_masterstarttime" size="6" maxlength="6" readonly="true"/>
<input name="text8" type="text" class="date" size="2" maxlength="2" readonly="true" id+"copy_ampm1">
&nbsp;<span class="style8">To</span>&nbsp;
<input name="text2" type="text" class="date" id="copy_masterendtime" size="6" maxlength="6" readonly="true"/>
<input name="text9" type="text" class="date" id="copy_masterampm2" size="2" maxlength="2" readonly="true"/>
</p>
<p><span class="style8">Where:</span>
<input name="text3" type="text" class="date" id="copy_masteraddress" size="30" maxlength="30" readonly="true"/>
</p>
<p>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<input name="text4" type="text" class="date" id="copy_mastercity" size="18" maxlength="18" readonly="true"/>
<input name="text5" type="text" class="date" id="copy_masterstate" size="4" maxlength="4" readonly="true"/>
<input name="text6" type="text" class="date" value="copy+masterzipcode" id="copy_masterzipcode" size="7" maxlength="8" readonly="true"/>
</p>
<p>&nbsp;</p>
</body>



<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<fieldset>
<div id="candlelogo"><img src="../My Documents/Unnamed Site 5/Picture2.gif" alt="candle logo" width="125" height="125" /></div>
<p>&nbsp;</p>
<div align="center" class="style4" id="copy2_joinus" span></div>
<p><span class="style19">&nbsp;&nbsp;&nbsp; </span><span class="style8">Date:</span>
<span><INPUT name="masterdayofweek" type="text" class="date" id="copy2_masterdayofweek" size="12" maxlength="12" readonly="true" /></span>
<input name="masterdate" type="text" class="date" id="copy2_masterdate" size="18" maxlength="18" readonly="true"/>
</p>
<div id="allyscandle"><img src="../My Documents/Unnamed Site 5/Picture1.gif" alt="allycandlelogo" width="300" height="209" align="top" /></div>
<p><span class="style19">&nbsp;&nbsp;&nbsp;</span><span class="style8"> Time:</span>
<input name="masterstarttime" type="text" class="date" id="copy2_masterstarttime" size="6" maxlength="6" readonly="true"/>
<input name="masterampm1" type="text" class="date" size="2" maxlength="2" readonly="true" id+"copy2_ampm1">
&nbsp;<span class="style8">To</span>&nbsp;
<input name="masterendtime" type="text" class="date" id="copy2_masterendtime" size="6" maxlength="6" readonly="true"/>
<input name="masterampm2" type="text" class="date" id="copy2_ampm2" size="2" maxlength="2" readonly="true"/>
</p>
<p><span class="style8">Where:</span>
<input type="text" class="date" id="copy2_masteraddress" size="30" maxlength="30" readonly="true"/>
</p>
<p>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<input type="text" class="date" id="copy2_mastercity" value="" size="18" maxlength="18"/>
<input type="text" class="date" id="copy2_masterstate" value="" size="4" maxlength="4" value="" />
<input type="text" class="date" id="copy2_masterzipcode" value="" size="7" maxlength="8" >&nbsp</span>
</p>
</fieldset>
<p>&nbsp;</p>
</body>

abduraooft
01-18-2009, 03:29 PM
bah! Please use
][/COLOR] tags to wrap your code while posting here, rather than changing the color of text. You may edit your above post.
Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum