tags:

views:

21

answers:

2

hi i have 3 jsp pages 1.parent 2. child 3.grandChild

how can i access a radio button in grandChild jsp in Parent Jsp

can i access like this

parent.parent.document.forms['AccountClosureForm']['DECISION'][0]==true

+1  A: 

I assume you either used page include directive or jsp include directive. I don't see any parent child relationship here. You would be able to share the whatever you have inside request or session or application scope. And I suppose you would have been using request, most probably.

From your code snippet, it looks you want to use it in JavaScript. Isn't it? If thats the case you can simply do something like document.forms["whatever"].... because its gonna be a single document on the client, no matter if you used a number of includes.

Adeel Ansari
that's truemy 2nd and 3 rd jsp has Parent and Child relation the 2 nd jsp is included in 1st Jsp by using <jsp:include page=here i want to get the fieldvalue of child jsp in to main Jsp(1st)any help pls
Sunny Mate
Tell us the story, what you are up to. We might be able to help.
Adeel Ansari
+1  A: 

you cannot

JSP is run server side, you dont have a Javascript document on your server

If you want to have jsp 'talk' to each other you can use session and request objects

But once all 3 jsp are send to the browser and rendered as HTMl you can use any JavaScript you see fit to achieve what you want

Peter