?
Solved

"Double linking"

Posted on 2003-03-17
8
Medium Priority
?
179 Views
Last Modified: 2010-04-01
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
0
Comment
Question by:Cmdr_Raptor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 8152088
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
 
LVL 28

Expert Comment

by:rrz
ID: 8152491
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
 

Author Comment

by:Cmdr_Raptor
ID: 8153367
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
kennethxu earned 180 total points
ID: 8153799
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
 
LVL 14

Expert Comment

by:kennethxu
ID: 8153836
or:
<html>
<head>
...
</head>

<body onload="form_reload.submit()">
...
<form action="menyLogg.jsp" name="form_reload" target="menu">
<input type='hidden' />
</form>
...
</body>
0
 

Author Comment

by:Cmdr_Raptor
ID: 8153972
Got it working! Tnx :)
0
 
LVL 35

Expert Comment

by:girionis
ID: 10060102
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question