The bottom frame has jsp that displayes info. According to time span. Example last 7 day, last 30 days , today, and all days.
Now my problem is I need to make it so the radio buttons on the first jsp page at top frame are connected somehow to the 2nd jsp at bottom so that when a user clicks on one of the radio buttons at top the bottom jsp responds by showing the approprate page.
I do not know how to pass the value of the radio button that is chosen to the 2nd jsp page?
The 2nd page has the <@ code in it to diplay the appropriate page. I just dont get how to tell the 2nd jsp page what radio button on the 1st jsp page is choosen.
I am not certain i understand what you have shown me. I dont see how the value(for example in my code "today") gets passed to a java method in a jsp.
any help appreciated
Joined: Nov 08, 2001
You need to get the data to that frame somehow. This is just pasing data from the client to the server. Hence why it was moved to this forum.
You can use the method I shown with a query string. That will allow you to access it wih your server side code.
If that does not work, then you need to submit the form in the top frame. In order to do that, you can set the target attribute with the frame name.
Those are the two ways to do it.
Joined: Dec 06, 2004
I came across the target=mainFrame thing for instance but I dont see what code actullay passes the variable to the method inside 2nd jsp?
I tried this but the jsp2 is oblivious to that it has been passed anything.
Joined: Nov 08, 2001
Frames act like seperate windows, your Java Code can not talk between them. The only way that you are going to get data from the client side (radio buttons) to the server side (your function display()) is by submitting a form or a querystring.
On your Java code you need to look at the querystring or the form submission parameters that are passed to the server. With that data you should be able to get the value "today" which you are after.
you can add it to the onclick event like onclick="document.formName.submit();"
So now when the user selects a radio button the form in the top frame is submitted and you place the target to your other frame. That frame can then grab the value from the form submission.