"Double linking"

I have a log-in pagefor members to log into the memberarea site. When the "LogIn" buton is clicked, a navigation servlet displays the memeberarea in a spesific iframe (after a login servlet has verified user and pass).

However, when a user click on LogIn and is verfied, I would like a new menu to load in a iframe where the menu is. So, with one click, I would like the member area to be displayed in the main iframe, while a new menu is displayed in the menu iframe.

The action of the form is the inparameter in the navigation servlet, and to have two actions, would reqire two forms as I can see. But then there would not be only one button, even if hidden wouls there(?). I really can't see any solutions, hope some of you can.

regards
-werner
Cmdr_RaptorAsked:
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.

kennethxuCommented:
there are two solutions to your problem, both involves javascript.

1. as you said, you can submit two form:
<form name=form1 target="iframe1"><input type="button" onclick="submitboth()" .... ></form>
<form name="form2 target="iframe2">.... </form>

<script>
function submitboth() {
  // transfer data from1 to form2, e.g. form2.field.value = form1.field.value
  form1.submit();
  form2.submit();
}
</script>

2. you submit one first to, say iframe1. in the page that display on iframe1, include a hidden form and use javascript to submit when page is load.

<form name="form2 target="iframe2">.... </form>

<script>
  form2.submit();
</script>
0
rrzCommented:
Kenneth gave two workable solutions but I thought of a third way.  When the Login button is clicked, the form that contains it targets the response to the top-level window. Then you can use JSP to decide (based on user session data) which pages to display in the frames.
<form target="_parent"  or use   <form target="_top"
0
Cmdr_RaptorAuthor Commented:
I've tried the second option you wrote kenneth, and it looks something like this now:

<head>
...
<script>
form_reload.submit();
</script>
...
</head>

<body>
...
<form action="menyLogg.jsp" name="form_reload" target="menu">
<input type='hidden' />
</form>
...
</body>

Not sure if I misunderstood you and did something wrong or what the problem is, but it don't work...

regards
-werner
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.

kennethxuCommented:
form must appears before script refer to it:

<head>
...
</head>

<body>
...
<form action="menyLogg.jsp" name="form_reload" target="menu">
<input type='hidden' />
</form>
...
<script>
form_reload.submit();
</script>
...
</body>
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
kennethxuCommented:
or:
<html>
<head>
...
</head>

<body onload="form_reload.submit()">
...
<form action="menyLogg.jsp" name="form_reload" target="menu">
<input type='hidden' />
</form>
...
</body>
0
Cmdr_RaptorAuthor Commented:
Got it working! Tnx :)
0
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to kennethxu

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0
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.