Solved

Frames (HTML)

Posted on 2007-11-16
8
167 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't get js code to execute 8 30
HTML question 2 23
Open grouped links on a page in new tabs via jquery 5 40
AngularJS: ng-repeat 25 19
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

685 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