I am new to javascript. I just want to take input in the created textfield.
So that I created a ul tag with id cstList.
and called a function listData() on the onclick event
Inside that I am trying to create a input tag inside a div tag.
After creation I am not able to type in the textfield.
Can anybody tell me, why is it so?
Here is my listData() code
function listData()
{
//var a = sessionStorage.getItem('id');
if(sessionStorage == null)
{
alert("Session storage not supported here");
}
else
{
var ss = sessionStorage.getItem('id');
alert("storage value is: "+ss);
}
var rows = prompt('Please type in the number of required rows');
var listCode = '';
for (var i = 0; i < rows; i++) {
var listID = 'list_' + i.toString();
var divID = 'div_' + i.toString();
var inputIdp = 'inputp_'+ i.toString();
var inputIdq = 'inputq_'+ i.toString();
// listCode += '<li id="' + listID + '><div id = "'+ divID + '"> <input type= "text" id= "boltQTY" name= "boltQTY" value = "abc"/> <input type= "text" id= "a" name= "boltQTY" value = "abc" size="5"/></div></li>';
listCode += "<li id='" + listID + "'><div id = '"+ divID + "'> <input type='text' id='" + inputIdp + "' name='" + inputIdp + "' value='' size='15'/> <input type='text' id='" + inputIdq + "' name='" + inputIdq + "' value='' size='15'/> </div></li>";
//variable = "string" + var1 + "string=' " + var2 +"' ";
}
document.getElementById('cstList').innerHTML = listCode;
}
I got an answer. That was the issue with the iscroll, discussed on the group.google.com.
Resolved the problem of entering the value in text field by the below code.
Create this code in new js file.