473,387 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Frame/form question

Hi.

I'm trying to build a page that has two frames, both of which are
generated by a different cgi script.

The lower frame is generated by a script called "control.py".

The upper frame is generated by a script called "getchat.py".

On the lower frame, there is a button called "REFRESH". When clicked, I
want it to be able to read information in a hidden input on a form in the
upper frame, that being .....

<input type=hidden NAME="last_seen" value = "' + str(lastByteLoc) + '">

.... and submit that information to getchat.py.

I have a javascript routine worked out which *usually* does that when I
view the page with konqueror. Unfortunately it never seems to work with
mozilla. Can anybody tell me why? And better still, how I can fix it?

Here's the code generated by control.py ......

In the <head> i have ....

<script language = "javascript">
<!-- hide from older browsers

function refreshPosts()
{
plast = parent.chatframe.form1.last_seen.value;
parent.chatframe.location = 'getchat.py?last_seen=' + plast
}

//-->
</script>

And on the form in the lower frame, I have this input ......

<input type = "button" value = "REFRESH" onClick = "refreshPosts()">

Thanx in advance.

Jul 20 '05 #1
4 2499
In article <pa****************************@yahoo.com.au>,
ch**************@yahoo.com.au enlightened us with...

function refreshPosts()
{
plast = parent.chatframe.form1.last_seen.value;


parent.chatframe is a window object. Form belongs to document.

plast = parent.chatframe.document.form1.last_seen.value;

--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
kaeli <ti******@NOSPAM.comcast.net> writes:
parent.chatframe is a window object. Form belongs to document.

plast = parent.chatframe.document.form1.last_seen.value;


or better yet (since I prefer to use the appropriate collections :)

plast = parent.frames['chatframe'].document.forms['form1'].
elements['last_seen'].value;

There is no official standard for Javascript access to frames,
so I can't say that using the frames collection is more official than
just assuming the frames are direct properties of their parent.

However, the W3C DOM specification requires the forms collection, and
there is no requirement that forms are available as properties of the
document element. That means that a (hypothetical) strictly standards
adhering browser (implementing nothing unofficial) will only work
using the forms collection.

Ditto for the elements collection.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
On Sat, 22 Nov 2003 15:25:31 +0000, kaeli wrote:
In article <pa****************************@yahoo.com.au>,
ch**************@yahoo.com.au enlightened us with...

function refreshPosts()
{
plast = parent.chatframe.form1.last_seen.value;


parent.chatframe is a window object. Form belongs to document.

plast = parent.chatframe.document.form1.last_seen.value;


Thanx. That does the job.

Now it works perfectly with mozilla but sometimes breaks when using
Konqueror. Specifically, when I press REFRESH, but there's nothing new to
update the chatframe with. After that, REFRESH won't work again until I
reload the whole page.
Jul 20 '05 #4
In article <pa****************************@yahoo.com.au>,
ch**************@yahoo.com.au enlightened us with...

Thanx. That does the job.

Now it works perfectly with mozilla but sometimes breaks when using
Konqueror. Specifically, when I press REFRESH, but there's nothing new to
update the chatframe with. After that, REFRESH won't work again until I
reload the whole page.


See Lasse's response - Konqueror may need the full reference instead of
the shortcut I'm used to (I do mostly intranet apps and only have to
deal with NN/IE).

--
--
~kaeli~
Press any key to continue or any other key to quit
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop"...
4
by: Timothy Elvidge | last post by:
In a two frameset split horizontally. How do I have a button in one frame (the menu frame) request the (details) frame to display itself with parameters. I.e in the top frame various options are...
1
by: clemenr | last post by:
Hi. I would like to know if the following is feasible in JavaScript. I would create a frameset where the top frame includes JavaScript. The bottom frame would be directed to the login page of an...
5
by: Tim Johnson | last post by:
Howdy: Let's suppose for illustration that I have a web page with 3 frames: Let's call them 'fStates', 'fCounties', and 'fCities'. On loading the page, fStates has a select list of states and...
4
by: anonymous | last post by:
Thanks your reply. The article I read is from www.hakin9.org/en/attachments/stackoverflow_en.pdf. And you're right. I don't know it very clearly. And that's why I want to understand it; for it's...
5
by: Kevin | last post by:
I have a Windows form with several Frame controls containing Textboxes, Comboboxes, Buttons, etc. The Enabled property on the Frames are set to False and the user can't edit any of the Textboxes...
0
by: onzinnig | last post by:
Hello, I have a problem where a frame does not repaint a part of a window when using the horizontal scrollbar. Easier then explaining is to try out the two html pages at the bottom of this...
42
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
4
by: Matt | last post by:
I am no JavaScript guru so please bear with me and be as detailed as possible with your response. I thank you in advance. I have an ASP page that contains form elements. I also have an inline...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.