Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2003-03-13
5
Medium Priority
?
293 Views
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!
0
Comment
Question by:maracucho
5 Comments
 
LVL 11

Expert Comment

by:fargo
ID: 8131429
Hello maracucho,

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

regards
fargo
0
 
LVL 14

Expert Comment

by:kennethxu
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?
0
 

Author Comment

by:maracucho
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;

...blahblah...

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

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.
0
 
LVL 3

Expert Comment

by:allahabad
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 ?
0
 
LVL 14

Accepted Solution

by:
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.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

571 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