OK I am very new to JS and people have been great helping me out but I am having an issue creating a form with multiple input elements. The second element is appearing but the first element is populating with the input.value from the second element and I get no value in the second
I've not used the DOM functions before so I may be messing up how I am calling them. Any help is greatly appreciated
newWindow = window.open("", null, "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
newWindow.document.title = "Info Window";
// create a form and set properties
var form = document.createElement('form');
form.action = 'http://google.com';
form.method = 'post';
// insert into the body of the new window
newWindow.document.body.appendChild(form);
// add text before the input
var cNumLab = document.createElement('cNumLab');
form.appendChild(document.createTextNode('Craft Number:'));
// add a text input
var input = document.createElement('input');
input.type = 'text';
input.name = 'input';
input.value = 'Enter Craft Number Here';
form.appendChild(input);
//add linebreak
var linebreak = document.createElement('br');
form.appendChild(linebreak);
// add text before the input
var sDescL = document.createElement('sDescL');
form.appendChild(document.createTextNode('Short Desc:'));
// add a text input
var sDesc = document.createElement('input');
input.type = 'text';
input.name = 'sDesc';
input.value = 'Enter Short Description Here:';
form.appendChild(sDesc);