jasonc Posted September 29, 2010 Share Posted September 29, 2010 I am currently using form_field.cols=20; in my code below to say how many columns, but wish to use the CSS width instead, how do I do this using javascript var container=document.getElementById('namesdiv'); var form_field=document.createElement('textarea'); form_field.id='name' + lines; form_field.name='name' + lines; form_field.cols=20; form_field.rows=2; container.appendChild(form_field); var br_field=document.createElement('br'); container.appendChild(br_field); Link to comment https://forums.phpfreaks.com/topic/214706-adding-new-field-to-page-how-to-specify-the-width-instead-of-cols-of-box/ Share on other sites More sharing options...
Psycho Posted September 29, 2010 Share Posted September 29, 2010 Replace form_field.cols=20; With this (using your preferred value) form_field.style.width = '350px'; Link to comment https://forums.phpfreaks.com/topic/214706-adding-new-field-to-page-how-to-specify-the-width-instead-of-cols-of-box/#findComment-1117197 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.