Hi,
I'm working in a struts application, one of the requirements is that if the user select a value, some new fields would be showed and the user should enter the information in them. Well I'm using a <div> to show the new fields, but when I process the form, it returns a NullPointerException so, the fields inside the <div> tag are not passing...I check the source of the .jsp file and in effect the fields are not there but in the form (not the source) the fields are present...it's so weird, I can see the field in the form but they are not present in the source.
Did anyone has an idea that can help me??
Here is the javascript to create the fields inside the <div>
if(form.item[8].value != ""){
qty = parseInt(form.qty[8].value);
var d=document.getElementById("div");
for(i=0; i < qty; i++){
d.innerHTML +="<bean:message key='msg.user' /><input type='text' name='username'><br>";
}
d.style.display = 'block';
}
Here is the <div> definition which is inside of the <form> tags
<div id="div" style="display: block;"></div>