Solved

Hidden frame refresh without losing focus on current frame

Posted on 2004-04-19
8
1,966 Views
Last Modified: 2008-03-06
CURRENT SITUATION

I have a frameset with 2 frames: Frame1 and Frame2.

Frame1 is hidden. Frame2 is of 100% height.

Code in 0.asp:
<frameset rows="0,*" frameborder="0" border="0">
  <frame src="1.asp" name=Frame1>
  <frame src="2.asp" name=Frame2 >
</frameset>

I have code in Frame1 which makes it refresh every 5 secs to retrieve data from the database.

Code in 1.asp:
  <body onload="setTimeout('document.location.reload()',5*1000)">
    <!--
    My asp stuff is here
    -->
  </body>
 

Frame2 is where I have all the site Browsing going on.

On one particular page in Frame2, I have a form with text input fields.

Code in 2.asp:
  <form action="2.asp">
    input1: <input type="text" name="input1">
    <br>
    input2: <input type="text" name="input2">
    <br>
    input3: <input type="text" name="input3">
    <br>
    input4: <input type="text" name="input4">
    <br>
    input5: <input type="text" name="input5">
    <br>
    <input type=submit value="Submit">
  </form>


PROBLEM:

The problem I am facing is that when the user is on 2.asp, filling the form, and 1.asp refreshes as it is supposed to, I lose focus on Frame2 and the next time I hit Tab to go the another form field, I end up in the address bar of the browser.

Is there a way that I can keep the hidden frame refreshing every 5 secs. And the not allowing to Frame2 to lose focus, so that filling the form fields is not a problem.

All Help will be appriciated.
Thank You.
0
Comment
Question by:bhavdeep_sachdev
8 Comments
 
LVL 6

Expert Comment

by:dgelinas
ID: 10862679
<form action="2.asp" onblur="this.focus();">
    input1: <input type="text" name="input1">
    <br>
    input2: <input type="text" name="input2">
    <br>
    input3: <input type="text" name="input3">
    <br>
    input4: <input type="text" name="input4">
    <br>
    input5: <input type="text" name="input5">
    <br>
    <input type=submit value="Submit">
  </form>

0
 
LVL 1

Author Comment

by:bhavdeep_sachdev
ID: 10863266
dgelinas,

It doesn't seem to work. When the hidden frame refreshes, the next time I hit TAB, the focus still goes to the Address Bar.
0
 
LVL 25

Expert Comment

by:devic
ID: 10872631
hi bhavdeep_sachdev,

try this:
============================================
<body onload="setTimeout('location=location.href;',5*1000);">
0
 
LVL 1

Author Comment

by:bhavdeep_sachdev
ID: 10872977
devic,

I earlier had

    <meta http-equiv="Refresh" content="5;test1.asp">
    <!-- This worked fine except for the Click Sound every 5 secs -->

in test1.asp instead on the

    document.location.reload()

Your solution is probably the same as the meta refresh (Also makes the Click sound when the page refreshes)

I know I should have mentioned it earlier that I don't need the Click Sound.

Do you still have a better solution ? Because the Clicking sound is a Big No for me.

I will wait for a solution without the sound and if I get one, I will increase the point value of the question and split it.

Thanks for the help
And STILL LOOKING for more help.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 25

Accepted Solution

by:
devic earned 350 total points
ID: 10874169
i don't have a click sound + refresh i have deactivated :)

try maybe with js include:
========================

-----------1.asp------------
<span id=cont>&nbsp;</span>
<script id=DJS src=content.asp></script>


----------content.asp-------------

document.getElementById("cont").innerHTML="bla bla bla your asp content";
setTimeout('document.getElementById("DJS").src="content.asp?"+((new Date()).valueOf());',5000);
0
 
LVL 1

Author Comment

by:bhavdeep_sachdev
ID: 10951567
I've not had time to implement this solution but I will look into your solution. I didn't really get what I wanted, but I will still grant you points for answering.... Thanks
0
 

Expert Comment

by:umeshswamy
ID: 11247655
i have 4 frames . when i press F5 key from keyboard the entire application gets refresh.
   what i need is when refreshed using F5 only the frame 4 should be refreshed without refreshing the other 3 frames.
   thanking in advance
0
 
LVL 25

Expert Comment

by:devic
ID: 11249650
hi umeshswamy,

welcome to EE.
you need open new question:
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/help.jsp#hi3
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now