Solved

Hidden frame refresh without losing focus on current frame

Posted on 2004-04-19
8
1,965 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
Comment Utility
<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
Comment Utility
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
Comment Utility
hi bhavdeep_sachdev,

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

Author Comment

by:bhavdeep_sachdev
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 25

Accepted Solution

by:
devic earned 350 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

744 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

17 Experts available now in Live!

Get 1:1 Help Now