Forums
This topic is locked
iFrames
Posted 21 Jul 2004 02:33:25
1
has voted
21 Jul 2004 02:33:25 Matt Millican posted:
Hi all,I'm developing a small application which will actually be using some iFrames. What I need to know is how do you set a link from an iFrame in one page, to go to another iFrame on the same main page? Does this make any sense?
TIA for any help.
Matt Millican
InternetMill.com
www.internetmill.com
(Win XP Pro / DWMX / Access XP / ASP / VBscript / PHP / MySQL)
Replies
Replied 21 Jul 2004 15:54:50
21 Jul 2004 15:54:50 Simon Martin replied:
Using the DOM (document object model)
When you name your page elements you can use them to refer to those things in your code, standard frames work in a similar way - you give them as the target.
The objects on the page have a heirarchy document.form[0].txtName.value
So though you might normally only refer to your button by 'txtName' its full name would be as shown above... it is the value of the element called 'txtName' in the first form in the array on the current document
Sharing knowledge saves valuable time!
Simon
[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
When you name your page elements you can use them to refer to those things in your code, standard frames work in a similar way - you give them as the target.
The objects on the page have a heirarchy document.form[0].txtName.value
So though you might normally only refer to your button by 'txtName' its full name would be as shown above... it is the value of the element called 'txtName' in the first form in the array on the current document
Sharing knowledge saves valuable time!
Simon
[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
Replied 23 Jul 2004 08:23:38
23 Jul 2004 08:23:38 Matt Millican replied:
I'm lost <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>. I dont think I quite understand what you're trying to say...
Sorry
Matt Millican
InternetMill.com
www.internetmill.com
(Win XP Pro / DWMX / Access XP / ASP / VBscript / PHP / MySQL)
Sorry
Matt Millican
InternetMill.com
www.internetmill.com
(Win XP Pro / DWMX / Access XP / ASP / VBscript / PHP / MySQL)
Replied 23 Jul 2004 14:01:33
23 Jul 2004 14:01:33 Simon Martin replied:
ok you've got 2 iframes on 1 page. give them both name attributes
<iframe name="iframe1" id="iframe1" src="something.htm"></iframe
and again for the other iframe
now when you want to pass something or load something into either iframe you need to set the target attribute of the <a> or <form> element to the name you've set.
The Object model I mentioned is a heirachy view of all things / objects on your document / page
[window.]document.getElementById(elementID).name
in this way you can get the value entered into a text box, the colour used for a background etc (DHTML)
but more importantly for you it will allow you to refer to the specific iframe you want - should the iframe exist in a different container eg another form...
document.form[0].iframe1
document.form[1].iframe2
Sharing knowledge saves valuable time!
Simon
[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
<iframe name="iframe1" id="iframe1" src="something.htm"></iframe
and again for the other iframe
now when you want to pass something or load something into either iframe you need to set the target attribute of the <a> or <form> element to the name you've set.
The Object model I mentioned is a heirachy view of all things / objects on your document / page
[window.]document.getElementById(elementID).name
in this way you can get the value entered into a text box, the colour used for a background etc (DHTML)
but more importantly for you it will allow you to refer to the specific iframe you want - should the iframe exist in a different container eg another form...
document.form[0].iframe1
document.form[1].iframe2
Sharing knowledge saves valuable time!
Simon
[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
Replied 28 Jul 2004 03:23:41
28 Jul 2004 03:23:41 Matt Millican replied:
Thanks much Simon,
Now I am on the right track <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Matt Millican
InternetMill.com
www.internetmill.com
(Win XP Pro / DWMX / Access XP / ASP / VBscript / PHP / MySQL)
Now I am on the right track <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Matt Millican
InternetMill.com
www.internetmill.com
(Win XP Pro / DWMX / Access XP / ASP / VBscript / PHP / MySQL)