Solved

Frames (HTML)

Posted on 2007-11-16
8
155 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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

13 Experts available now in Live!

Get 1:1 Help Now