Solved

Frames (HTML)

Posted on 2007-11-16
8
175 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Technology Partners: 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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Suggested Courses

631 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