<div id="bodyC" class="bodyC" align="center">
<table width="60%" height="100%"><tr>
<td class="bodyCC" id="bodyCC" height="100%" width="59.7%">
<table id="MYtable" class="MYtable" border="0" width="100%" height="50%" cellpadding="50"><tr>
<td id="one" width="33%" class="one" onclick=""></td>
<td id="two" width="34%" class="two" onclick=""></td>
<!--<td id="three" width="33%" class="three" onclick=""></td>--></tr>
</table>
</td></tr>
</table>
</div>
javascript part:
function contact()
{
document.getElementById('one').onclick="";
document.getElementById('two').onclick="";
document.getElementById('one').width="25%";
document.getElementById('two').width="75%";
document.getElementById('one').style.cursor="";
document.getElementById('one').vAlign = "top";
document.getElementById('two').vAlign = "top";
document.getElementById('one').style.backgroundImage = null;
document.getElementById('two').style.backgroundImage = null;
document.getElementById('one').style.lineHeight="150%";
document.getElementById('two').style.lineHeight="50%";
document.getElementById('two').align = "left";
var GPwidth = document.getElementById('bodyC').style.width;
GPwidth = GPwidth * 20;
document.getElementById('one').innerHTML = "<p id='pOne' heigth='100%'>First Name: <input type='text' name='Fname' id='Fname' class='Fname' maxLength='20' size='20'/><br><br>Last Name: <input type='text' name='Lname' id='Lname' class='Lname' maxLength='20' size='20'/><br><br>Email: <input type='text' name='email' id='email' class='email' maxLength='20' size='20'/><br><br>Subject: <input type='text' name='subj' id='subj' class='subj' maxLength='20' size='20'/></p>";
document.getElementById('two').innerHTML = "<br><textarea style='font-family:arial,sans-serif' rows='14' cols=58 name='Tarea' class='Tarea' id='Tarea' height='100%'></textarea><button type='button' onclick='Email()'>Send</button>";
document.getElementById('Tarea').overflow="auto";
document.getElementById('Tarea').cols = GPwidth;
}
css part:
#bodyC { position:fixed; top:40%; left:-1; width:100%; height:60%; }
.bodyCC
{
background-image: url(http://oi45.tinypic.com/m7gqcx.jpg);
position: fixed;
background-repeat: no-repeat;
background-size: 100% 50%;
}
I only copied the parts that matter.
bodyC is sort of the background table, and i'm trying to make the cols in the textarea to be relative to its' width.
i've tried
var GPwidth = document.getElementById('bodyC').style.width;
GPwidth = GPwidth * 20;
document.getElementById('Tarea').cols = GPwidth;
(which you can see in the javascript part)
but each time it gives me 0 cols.
i've also tried changing the "width=100%" in the CSS to "width=800" but there still were 0 cols.
can anyone help?

New Topic/Question
Reply


MultiQuote




|