PDA

View Full Version : Form in New window and specific frame? HELP PLEASE



elite-fusion
Sep 25th, 2009, 09:56 PM
Hey guys, im new to the forums but im stuck and totally clueless...please helpppppppp

so... i have PAGE1.HTML and on that page i have a form script that is called Search, in that search box i want people to put in anything they want to search for on google.com...on PAGE2.html i have two frames, the top frame is going to be a navigation bar with my logo and navigation, and on the bottom frame i will have google.com linked to it...SOOOO i want to make it so that when people submit the form on PAGE1.HTML, not only does it open up PAGE2.html but for it to link to the bottom frame, so basically when a person presses Search, it will open up google but with my personal frame on top.....any ideas how to do that? please help guys :(

jolly_nikki
Sep 25th, 2009, 11:04 PM
Page1.html

<html>
<head>
<script>
function redirectPage(){
var searchCriteria = document.getElementById("searchCriteria").value;
if(searchCriteria != ""){
location.href = "Page2.html?" + searchCriteria;
}
}
</script>
</head>

<body>
Search: <input type = "text" value = "" id = "searchCriteria" >
<input type = "button" value = "Search" onclick = "redirectPage()" >
</body>

</html>


This is Page2.html


<html>
<body>
<html>
<head>
<script>
function setFrameSrc(){
var urlquery=new Array();
urlquery=location.href.split("?");
document.getElementById("frame2").setAttribute("src",
"http://www.google.com/#hl=en&source=hp&q="+urlquery[1]);
}
window.onload = setFrameSrc;
</script>

</head>
<body>
<frameset cols="100%" >
<frameset rows="40,*">
<frame src="navigation_bar.html" >
<frame src="" id = "frame2">
</frameset>
</frameset>
</body>
</html>
</body>
</html>

elite-fusion
Sep 30th, 2009, 02:08 PM
hey guys, sorry for the late reply, i've been swamped with work :(

i just used google as an example, will this work if i want to load something else as well because the way that my work website works is that when you put in a screenname in the url http://www.blah.com/userinput.cgi...it stays at the same url as http://www.blah.com/userinput.cgi...so it doesnt change anything in the url when searching for a certain user as google would when searching for anything...so how would i make this work?