Problems with form request, generated by InnerHTML (JavaScript) in a JSP page

Posted on 2003-03-13
Medium Priority
Last Modified: 2010-05-18
Hi Guys, i got a problem sending a form, generated dinamically by a InnerHTML.
The problem is: i generate some input textfields with this function (its working very well), but this parameters cant pass throw the request form (i cant catch nothing in the action page). I try in plain html without a problem, i think its a JSP problem.
I appreciate a little help... thanks!
Question by:maracucho
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Expert Comment

ID: 8131429
Hello maracucho,

If you could post your code..then someone can possibly help you.

LVL 14

Expert Comment

ID: 8131445
you said you have no problem with html, then rename you foo.html to foo.jsp, is it still work? if yes, then start to modify you foo.jsp by adding dynamic information. and then at the browser side, use view source to see if you get the same html source?

Author Comment

ID: 8132372
thanks guys,and... about my code,
check it out:
<script LANGUAGE = "JavaScript">
function ponerPreguntas(i) {
if(i != null) {
  var preguntas = '';
  for(var j=0; j<i; j++)
     preguntas += '<tr><td>Opcion ' + (j+1) + ': <input type=text name=opcion' + (j+1) + '></td></tr>';
     document.getElementById("preguntas").innerHTML = preguntas;


<form name="crearencuesta" method="POST" action="encuestaCreada.jsp">
...<table id="preguntas">
<input type="submit" name="Submit" value="Enviar">

and, about encuestaCreada.jsp:
Enumeration paramNames = request.getParameterNames();
                while (paramNames.hasMoreElements())
                        String currentName = (String)paramNames.nextElement();
                        String currentValue = request.getParameter(currentName);

                        System.out.println(currentName + " = " + currentValue);

Sorry about my spanish...Thankyou again...

P.D. I worked in the same way you said kennethxu, prior post my question. I dont know how, but the html version works (even with cgi-perl) without modify the source view. Actually, im using Netscape 6 for linux.

Expert Comment

ID: 8132949
Make action="GET", and check what parameter name and value do see in the URL, after testing it,you can change it back to "POST", this is just to check param names and their values.

If you are getting those params in URL, then you can see in the server log about error may have occurred in encuestaCreada.jsp.

If you still can'nt resolve this ? Could you post us your entire jsp codes for both jsps ?
LVL 14

Accepted Solution

kennethxu earned 100 total points
ID: 8133024
is your encuestaCreada.jsp have problem or first part of you code have problem?

if your problem is the first part of code, looks more like a javascipt question.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question