Multiple Form Submit/Login to two Servers

P

plex4r

I have a requirement to accept userid/password on a form and login to
two servers. The authenticated homepage for each is to be displayed in
two different iframes. I have an issue which I believe is a race
condition because my code has worked a few times.
I can make the code always work by putting an 'alert()' call between
the submits. The code below shows where the alert box must be.
The behavior I get without the alert() is normally the first form
submit works, but nothing happens in the second submit.
I have tried many things:
1. Use setTimeout("funct()", time) to make the second submit occur
after the first should be complete. I get the same results, requireing
an alert() in funct().
2. Point the initial iframe at the other servers login.jsp page and
hardcode the username/password as strings. I get the same behavior
requiring alert()

Any ideas what I can do?

Initial file with
iframes================================================
<html><head>
<title>Portal Intranet</title>

<body>


<div id="portalBarDiv" style="width:800;
background-color:lightblue; position:absolute; left: 0; top: 0;
z-index:10" >
<iframe id="portalBarIframe"
name="portalBarIframe" src="/trifleet/pages/shared/login.jsp"
align=left frameborder="0" width=1020 height=150 scrolling=no
style="width:800; height: 800;
border: none;">
</iframe>
</div>

<div id="trifleetDiv" style="position:absolute;
left: 0; top: 835; z-index: 6; ">
<iframe id="trifleetIframe"
name="trifleetIframe"src="" align=left frameborder="0" width=1020
height=800 scrolling=yes
style="border: none;">
</iframe>
</div>


</body>
</html>

Login form ==========================================================
<html>
<head>
<title>Login</title>
<SCRIPT language="JavaScript" type="text/javascript">
function OnClickLogin()
{
document.loginForm.target = "portalBarIframe";
document.loginForm.submit();
//alert("Block Here!");
document.loginForm.action =
"https://my.otherServer.com:446/trifleet/j_security_check";
document.loginForm.target = "trifleetIframe";
document.loginForm.submit();
return true;
}

</script>

<form name="loginForm" action="j_security_check" method="post">
<!-- <FORM onsubmit='return OnClickLogin()' method="post"
NAME="loginForm" action="j_security_check">
-->
<FORM method="post" NAME="loginForm" action="j_security_check">

Name: <input type="text" size=25
name="j_username" >
<br>
Password: <input type="password" size=25
name="j_password">
<INPUT TYPE="button" onclick="return OnClickLogin(); " >

</form>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top