Posted by: दार्जीलिङे-दाई August 23, 2008
Frames in Frameset - HTML
Login in to Rate this Post:     0       ?        
Thyangboche bro,

I am still trying to find some solution to your problem. I hope the following codes will be helpful to you. Please test it and try to complete it if it is what you want. The codes can display Name on left frame and UserID on right frame, but for some reason Submit button form created by javascript is not doing the work properly so I am still trying to find something to bring back "form" below the result. If time permits, in the mean time, I will keep looking to solve that too. Hope this helps.


index.html

<HTML>
<HEAD>

<TITLE>MAIN PAGE</TITLE>

</HEAD>

<FRAMESET COLS="50%,50%">

    <FRAME SRC="leftFrame.html" NAME="left">
    <FRAME SRC="rightFrame.html" NAME="right">
</FRAMESET>
</HTML>

left frame:

<HTML>
<HEAD>

<TITLE>Left Frame</TITLE>


<script language="Javascript">

function nameFind(userIDnumber)
{
 

switch(userIDnumber)
{
case "001" :
 userName="Ram";
 document.write("NAME : " + userName);


break;

case "002" :
 userName="Shyam";
document.write("NAME : " + userName);


break;

case "003" :
 userName="Sita";
document.write("NAME : " + userName);
break;

case "004" :
 userName="Hanuman";
document.write("NAME : " + userName);
break;

case "005" :
 userName="Laxman";
document.write("NAME : " + userName);
break;

case "006" :
 userName="Ritthe";
document.write("NAME : " + userName);
break;

case "007" :
 userName="Banduke";
document.write("NAME : " + userName);
break;

case "008" :
 userName="Chaure";
document.write("NAME : " + userName);
break;

case "009" :
 userName="Dalle";
document.write("NAME : " + userName);
break;

default:
 
document.write("NAME NOT FOUND");
break;
}
}

</script>

</HEAD>
<BODY>

</BODY>

</HTML>
   

Right Frame

<HTML>
<HEAD>
<TITLE>Right Frame</TITLE>
</HEAD>
<SCRIPT language="JavaScript" type="text/javascript">
<!--

function displayID()
{

var userIDnumber = document.getElementById("userID").value;
top.left.nameFind(userIDnumber);
document.write("UserID : " + userIDnumber);

}

//-->

</SCRIPT>

<BODY>

<form onSubmit="displayID()">
<input type="text" id="userID">
<input type="submit" value="getID">
</form>

</BODY>
</HTML>  
Read Full Discussion Thread for this article