By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,781 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,781 IT Pros & Developers. It's quick & easy.

Replace frame URL with entered word

P: 3
I have a simple frame set up. With a header box containing the logo, and two columns underneath, the working part.
In the left side there is a form box to enter request into.
The request will be names of colors like; red, purple, yellow, blue and others.
Once the name of the color is entered into the box, and enter is hit, the desired color is shown in the 2nd column.

The entered word will need to be combined into a URL statement like this.
http://www.server.com/%REPLACETHIS%.html

With %REPLACETHIS% being replace by the entry word from the client.

The files stating colors are single files and are located on the server.
http://www.server.com/red.html
http://www.server.com/purple.html
http://www.server.com/yellow.html
http://www.server.com/blue.html

I don't want to set up a CGI-BIN search or Google search added to the site.



Thank you for any help and direction!









--------------------------------------------------------------------------------
Who's never won? Biggest Grammy Award surprises of all time on AOL Music.
Feb 4 '08 #1
Share this Question
Share on Google+
5 Replies


P: 3
I have a simple frame set up. With a header box containing the logo, and two columns underneath, the working part.
In the left side there is a form box to enter request into.
The request will be names of colors like; red, purple, yellow, blue and others.
Once the name of the color is entered into the box, and enter is hit, the desired color is shown in the 2nd column.

The entered word will need to be combined into a URL statement like this.
http://www.server.com/%REPLACETHIS%.html

With %REPLACETHIS% being replace by the entry word from the client.

The files stating colors are single files and are located on the server.
http://www.server.com/red.html
http://www.server.com/purple.html
http://www.server.com/yellow.html
http://www.server.com/blue.html

I don't want to set up a CGI-BIN search or Google search added to the site.

Thank you for any help!
Feb 4 '08 #2

gits
Expert Mod 5K+
P: 5,353
hi ...

you may use the window.location.href property of a window (frame) here, call a function like this, when your action occurs:

Expand|Select|Wrap|Line Numbers
  1. function open_page(node, frame) {
  2.     var url = 'http://www.server.com/%s.html';
  3.     url = url.replace(/%s/, node.value);
  4.  
  5.     frame.location.href = url;
  6. }
  7.  
pass references to the node (input-element) and the target-frame to it ... in case you have problems with it then post your code so that we may look at it together ...

kind regards
Feb 4 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

Thanks!
Feb 4 '08 #4

drhowarddrfine
Expert 5K+
P: 7,435
html/css cannot do this. You need javascript so I'll send this there.
Feb 4 '08 #5

gits
Expert Mod 5K+
P: 5,353
threads merged ...

kind regards
MODERATOR
Feb 4 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.