Using Two Frames, Capture the value of a <select> option and set it to a variable

Hello Experts,

I have an JSP page with two frames.  Upon a submit, I want to capture the value of one of my frames(frame1) and set it to a variable (i.e. Java variable) in my other frame (frame2).  For example,

frame1:
<form name="test">
<select name="count">
  <option value="0">0</option>
  <option value="5">5</option>
  <option value="10">10</option>
</select>
<input type=submit>
</form>

frame2

//get the value from "count"
int mycount = count;

How can this be done?  I tried setting a hidden variable in frame2 and setting it from frame1 upon a submit, but that didn't seem to work.
Ex:

frame1:

//Javascript
 parent.positions.document.forms[''].elements['mytest'].value=
              document.forms[0].elements['count'].options[
                  document.forms[0].elements['count'].selectedIndex
              ].value;    

frame2:

 <input type="hidden" name="mytest" value=""> //can I somehow extract this value in my page and set it to a variable?

Thank you for your help!
jollykhAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
Let me clarify.

1)You want to set the hidden parameter of frame2 when the frame1 is submitted?? Is it?

2)Or you want to take a value from frame 2 and set the value in frame1 ?

2nd option is quite possible. The first option is not.

regards,
fargo
0
jollykhAuthor Commented:
Hello Fargo,

I'm looking at option 1.  This is possible through javascript (see the snippet of code in my originial question).  My question is once I <b>set</b> the value, can I <b>get</b> the value in the JSP?

Thanks!
0
TimYatesCommented:
you could have a third hidden frame which posts the value to frame 2 before posing this form to frame 1

Tim
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jollykhAuthor Commented:
I have come to discover that the only was I can get this accomplished is by calling the request.getParameter from my java class and setting the variable to the session.

Thanks everyone for your help!
0
TimYatesCommented:
ok by me
0
GranModCommented:
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.