Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2004, 07:48 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default detecting a form

Hello !

I want to detect if a form is in a document.
In facts, I have a field that displays the value of another field in a form that's in another page (I'm using frames, one page does refresh every 2sec, one never refresh but displays the content of the refreshed one)

the window.onerror method tells me 'not implemented' ...

thanks guys.

 
Old April 19th, 2004, 03:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

try something like :

<html>
<body>
<form name="myForm">
<input type="text" size="10" name="fieldOne" value="100">
</form>
<script language="javascript">
if (document.myForm)
{
    alert(document.myForm.fieldOne.value);
}
</script>
</body>

If the field is in another frame you will need to access it via something like :

parent.main.myForm.fieldOne.value

if you are accessing the value of fieldOne in the form myForm which is in the frame called main which is defined in the same frameset as the current frame.
</html>
 
Old April 20th, 2004, 06:53 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you, that works fine !






Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting a Yahoo Toolbar MosheGolden Classic ASP Professional 0 November 23rd, 2006 02:32 AM
Troubles with detecting the 'right' window slgknjn Pro VB 6 0 May 24th, 2006 04:03 AM
Detecting frame size dlk Java GUI 1 August 1st, 2005 06:36 PM
detecting mosue click outside of form vb certified VB.NET 2002/2003 Basics 0 June 30th, 2005 08:34 PM
Detecting Read-Only rgerald Access VBA 6 October 30th, 2003 04:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.