Here is what I am trying to achiever -
I have a db query that returns multiple rows.
These rows are displayed in table.
The rows have a field (Column) EventID, which is a hyperlink. On clicking that hyperlink the value should be passed to another jsp page that will run 1 more query (using the EventId that was clicked) and display the results
Here is my code snippet -
<!-- displaying table with hyperlinks. populateTextArea function displays the event id that was clicked -->
document.getElementById('textarea').value = string;
<jsp:include page="page1.jsp" flush="true">
<jsp:param name="event" value="document.getElementById('textarea').value "/>
<jsp:param name="password" value="rose"/>
any ideas on how to get this working.
The best way can be open the pop up page once you click on the hyperlink.
Joined: Oct 31, 2012
I need to display the information on the same page, as I dont want users to close so many pop-ups.
Mouse hover over would be ideal in this scenario, but since I am very new to scripting, taking baby steps.
I know that 1 possible solution is using ajax call, but I have never used it before.
On the other hand, the only thing you want to be dynamic is a <jsp:param>. You can't feed a client-side parameter to that tag (because the client doesn't see the tag), but you could search and replace the event in the area that's created.
So something like:
Then make your onclick handler look for the PLACEHOLDER values and replace them with document.getElementById('textarea').value.
Thank you Greg, I tried creating PLACEHOLDERs but I guess I could not reach a working solution.
Thank you Bear for pointing out jquery. I got a working solution with a combination of all solutions -
When I click on a link, function getEventID is called, which uses jquery load to load viewEventIDDetails with parameter eid
var eid = string;