Hola amigos una vez mas aca preguntando queria saber si hay la posibilidad de insertar objetos con javascript, para una pagina jsp me explico un poco mejor quiero insertar objetos de esta manera
Código HTML:
<html:text maxlength="15" size="12" value="" property="tFonNew" />
Código HTML:
<html:select size="1" property="cboNuevoTipo">
<c:forEach var="tipo" items="${tiposContacto}">
<option value="<c:out value="${tipo.codigo}"/>"><c:out value="${tipo.descripcion}"/></option>
</c:forEach>
</html:select>
Hasta el momento lo hacia de esta manera
Código HTML:
var t=document.getElementById('formulario').innerHTML;
tipoCod = document.forms[0].cboNuevoTipo.value;
t+="<table class='CriteriosTable' bgcolor='#C0C0C0' width='100%' cellspacing='2' cellpadding='1' border='0'><TR>"+
"<td width='10%' height='25' bgcolor='#f4f4f4' align='center'><input type='checkbox' name='checkbox' value='155'></td>"+
"<td width='30%' height='25' bgcolor='#f4f4f4'><input maxlength='256' size='60' type='text' name='checkbox' value='"+document.forms[0].txtRSNew.value+"'></td>"+
"<td width='10%' height='25' bgcolor='#f4f4f4'><input maxlength='15' size='12' type='text' name='checkbox' value='"+document.forms[0].tFonNew.value+"'></td>"+
"<td width='10%' height='25' bgcolor='#f4f4f4'><input maxlength='15' size='12' type='text' name='checkbox' value='"+document.forms[0].tFaxNew.value+"'></td>"+
"<td width='20%' height='25' bgcolor='#f4f4f4'><input maxlength='60' size='28' type='text' name='checkbox' value='"+document.forms[0].tEmailNew.value+"'></td>"+
"<td width='5%' height='25' bgcolor='#f4f4f4'><input type='checkbox' name='checkbox2' value='checkbox'></td>"+
"<td width='10%' height='25' bgcolor='#f4f4f4'><select size='1' name='select'> "+
"<c:forEach var='tipo' items='${tiposContacto}'>"+
" <option value='<c:out value='${tipo.codigo}'/>' <c:if test='${tipoCod == tipo.codigo}'>selected</c:if>><c:out value='${tipo.descripcion}'/></option>"+
" </c:forEach>"+
"</select></td>"+
"</TR></table>";
document.getElementById('formulario').innerHTML=t;
pero al momento de insertar los otros objetos me tirar error, alguna ayuda o no me explique bien
Saludos .......