Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

div tag inside a jsp

843840Aug 16 2007 — edited Aug 17 2007
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>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2007
Added on Aug 16 2007
4 comments
814 views