Long time, first time.
I have a simple JSP question, and you will have to forgive me because I know this has been answered on these forums before, but I can't seem to get them to work for my application.
I have a series of check boxes, text boxes, and radio buttons in a form. What I'd like for is when the user submits the form on one "test.jsp" page, these parameters are added to the URL query string and are present on the submitted page "result.jsp", such as:
Is anyone able to provide a sample code snippet for what the "test.jsp" page should look like for this?
Here's my form:
Can I write a JS function that builds the URL parameters, then just append it to the action="result.jsp" when submitted? I would consider this a dirty solution, but what would the action="" look like if you want to call a JS function that does this? Can you submit a form within JS?
Thanks! Using the get method showed exactly what I needed .. then I could just use <% request.getParameter("name") %> to build my result.jsp page with these parameters. Doing it this way matters to me only for learning, which I hope is not an issue here?
Thanks for the advice. I'll mark this one resolved.
andy kra wrote:Using the get method showed exactly what I needed .. then I could just use <% request.getParameter("name") %> to build my result.jsp page with these parameters.
Three important points here:
Doing it this way matters to me only for learning, which I hope is not an issue here?
If you are just learning, you are definitely heading down the wrong path, using antiquated and discredited techniques. Modern JSPs should contain no Java code.
First, read this JspFaq entry.
Then I always suggest that newcomers to JSP read the following articles: