Solved

Frames (HTML)

Posted on 2007-11-16
8
158 Views
Last Modified: 2013-11-19
I would like to create a page that look like

http://img115.imageshack.us/img115/6212/16d62ad98fa90a92dcd316clh1.png

Where frame 1 can have something searched in it.. and then is searches it in 2

Also frame 2's URLs will be in the format

https://something.com/blah.ext?something=blah&words=TEST

And on change of frame 2 it looks for
&words=WHATEVER
and Changes the title of the "main" page.to WHATEVER - Something
(the last three lines only apply if frame 2 is on either of two domains, if not then default to a title "something".

I've tried with frames and iframes, but since I have used them for years I am not sure how.
I would also like a close top frame button, which will close the top frame.. and leave the bottom frame *asis*<--- important.
0
Comment
Question by:mnb93
  • 4
  • 4
8 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20303918
<frameset rows="100,*">
<frame name="searchbar" src="searchbar.html">
<frame name="resultFrame" src="about:blank">
</frameset>


searchbar:


<form target="resultFrame" action="http://www.google.com/search">

<select onChange="val=this.options[this.selectedindex].value;

this.form.action=val">

<option value="http://www.google.com/search">Default</option>

<option value="http://www.msn.com/search">MSN</option>

<input type="text" name="q" value="">

<input type="submit" value="search" style="background-color:orange">

</form>

<span style="float:right"><a href="#" onClick="document.forms[0].target='_top';document.forms[0].submit();

return false">remove frames</a></span>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20303919
You need a little more code if you need to change the name of the search field
0
 
LVL 5

Author Comment

by:mnb93
ID: 20304127
Not sure you understood this part:

Also frame 2's URLs (src=) will be in the format

https://something.com/blah.ext?something=blah&words=TEST

And on change of frame 2 it looks for
&words=WHATEVER
and Changes the title of the "main" page.to WHATEVER - Something
(the last three lines only apply if frame 2 is on either of two domains, if not then default to a title "something".

The remove frame seems to be ok. I'll test tomorrow.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 20304274
yes I understood, just forgot it when I coded...
And I did not understand what else you wanted the library to contain so I gave you a way to use it...

Ignoring the library dropdown (and your "either of two domains" which I do not understand - the domain of frame two will be what is in the action) for a moment:


<form target="resultFrame" action="https://something.com/blah.ext"

onSubmit="top.document.title=this.words.value">

<input type="hidden" name="something" value="blah">

<input type="text" name="words" value="">

<input type="submit" value="search" style="background-color:orange">

</form>

<span style="float:right"><a href="#" onClick="document.forms[0].target='_top';document.forms[0].submit();

return false">remove frames</a></span>

Open in new window

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 5

Author Comment

by:mnb93
ID: 20305871
hm.. I meant something like:

Frame2.onchange = function {
Document.title = Frame2.src;
}

I'm sure none of the above is actually what it should be.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20307199
You cannot access the source of a frame with content not from the same domain as the script.

Also why would you want

https://something.com/blah.ext?something=blah&words=TEST

as a title?

If you really want that then change
onSubmit="top.document.title=this.words.value">

to

onSubmit="top.document.title=this.action+'?something='+escap(this.something.value)+
'&words='+escape(this.words.value)">
0
 
LVL 5

Author Comment

by:mnb93
ID: 20307304
hm.. that sucks, I'll try out everything about then allocate your points.
0
 
LVL 5

Author Closing Comment

by:mnb93
ID: 31409707
Cheers.
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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

911 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

27 Experts available now in Live!

Get 1:1 Help Now