Hi,
I'm very new to JS and just playing around with some basic stuff, so far I have;
This just creates up to 10 text boxes when the user presses the button. However, the text boxes are placed side by side until they have to go on to a new line.PHP Code:var currentTxtBx = 0;
function addTxtBx(){
if (currentTxtBx<10){
if (currentTxtBx<10){
var txtBxTable = document.getElementById('txtBoxTable');
var newTxtBx = document.createElement('input'); // creates the text box element
newTxtBx.type = 'text'; // declares the text box as text
newTxtBx.name = 'check'+(currentTxtBx+1); // declares the value of the text box
currentTxtBx++;
txtBoxTable.appendChild(newTxtBx);
}
}
else
{
alert('cannot add more than 10 boxes');
}
}
How would I go about creating and inserting a line break so that after each text box a line break would occur so that they're all place one below another?
Thanks


Reply With Quote

Bookmarks