Solved

Frames (HTML)

Posted on 2007-11-16
8
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Anyone familiar with PhotoSwipe? 3 42
Do I need to force my browser to see my new Favicon 4 50
HTML CSS and  Table design 4 70
Jquery Calculation 3 42
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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

739 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