-1

and Thanks in advance to all for even taking time to read my question. Now to summarize the question I am trying to somehow pass a value when you click on an anchor tag which when the new page loads, where a form is located, a certain form field to be auto populated. Now to go into detail, let me explain what I am trying to do in the project

when you go to this link http://wwwtest.courts.mo.gov/civiceducation/presentation.html , you can see that next to each presentation topic there is a request this presentation link. when you click the link, it will take you to a form http://wwwtest.courts.mo.gov/civiceducation/request_presentation.jsp .

Now on the first page (presentation.html), all 3 "request this presentation" link point to the same page with all empty fields. All i want to do is when the "request this presentation" link for a particular topic is clicked, when it goes to the next page ( request_presentation.jsp) the form opens but this time the "select" field titled "name of presentation" should be prefilled with the topic. i hope i made this clear but if not please let me know.

If there is an easier or a different logic that can be used please guide me in the right direction. Thanks in advance

Sai
  • 1,889
  • 5
  • 18
  • 26
  • 1
    one option would be to pass the name of presentation as a querystring to request_presentation.jsp and get the querystring there and fill the `name of presentation` field with that value. – Lal Aug 08 '14 at 17:02
  • you can pass querystring as `Next` – Lal Aug 08 '14 at 17:04
  • Thank you. I was able to dig a little deeper into the querystring and found a nice solution for my problem. I applied what you had suggested along with the solution presented [**in this link here**](http://stackoverflow.com/questions/4656843/jquery-get-querystring-from-url) and then stripped/ parsed the querystring and replacing the %20 for spaces etc and was able to assign the value onto the field. Thanks again. Now if you can please put your suggestion as an answer, then I can give you the proper credit you deserve. – Sai Aug 08 '14 at 20:30

2 Answers2

1

Try using get variables. For example use a link to 'http://wwwtest.courts.mo.gov/civiceducation/request_presentation.jsp?request=skokie', Then in your option list use check the value of the request get var against your options. Im a little fuzzy on the syntax, so check out This answer for a more complete answer.

Community
  • 1
  • 1
wolffer-east
  • 1,069
  • 7
  • 14
  • Thanks to you as well for the answer. Your answer is almost what I followed as well but part way through. The query srting part was the right way to proceed but the link that you referred would probably have been an overkill. Thanks anyway – Sai Aug 08 '14 at 20:39
0

From my earlier comments,

one option would be to pass the name of presentation as a querystring to request_presentation.jsp and get the querystring there and fill the name of presentation field with that value.

you can pass querystring as

<a href="request_presentation.jsp?nop=presentation1">Next</a>

and get the querystring in jsp page as

String presentation=request.getParameter("nop");

The string presentation will contain the querystring and you can set that string to the textfield.

Try it..

Lal
  • 14,726
  • 4
  • 45
  • 70