![]() |
Hey,
I am currently trying to get a iframe to move location when a Search button is clicked on. Here's some code to help me explain: :
<html>searchb is the textbox that the user types in their search string. Anyways, this function doesn't work, when the button is clicked. Here's the code for the button. :
<input type="submit" value="Search" onclick="search()">Does anything look out of place to you guys? I am not very good at javascript, since i havn't used it alot in the last three years. I have tryed reading a bit on the net, however i don't really have the time to really sit down and read. Thanks for your help in advance. |
Why have you got a string in the location? I'm not sure exactly how that one works (I've never used it), but doesn't it just take a number?
So, what exactly are you trying to do? |
the only way i could think of doing it is having a second frame in the location where you want it to move to then using window.open command in javascript to open it up. And also hide the other frame.
|
I am pretty sure that you can change the location of an iframe , and i think i have done it before....i just can't remember how. ;-)
Quote:
I'll post back today when i find the answer. |
Oh, I see... it's like a goto thingy. Fair enough.
|
Yeah, then in the page that gets called, i have a switch running which code i want.
|
i would use a server side scripting and just chuck something in teh url you are sending
:
thats java btw :) would give you 2 different pages, i could show you the code to do it in php or asp .net as well and the rest of them could show you in the other languages they no. |
What i am trying to do, is when the user enters somthing into the search box and clicks the "Search" button a frame on the page will change location and display the search results. For the search code (it's in php) to work, i need to have a url somthing like this: cuslist.php?action=search&sstring=K. cuslist.php is a php file that handles all of the customer search functions as well as displaying any infomation about the customer. So when the cuslit.php file is called i have a switch that looks at the action part of the query string, and executes some code according to what the action part of the string is. The second part of of the query string is the actual search string that get's checked against the db. Anyways, the only problem that i have with this stuff is the java redirect side of it. I don't think that i can do server side scripting because the user must type somthing in before we can redirect it , otherwise i would use php to do it. I am testing in firefox. I have found scripts on websites that do what i want to do, but when i implement them into my page they don't work, do you guys think it could be firefox causing the problem?
|
if i am correct in thinking you want to load a page that says searching then that page redirects to a final page?
well with javascript you can use, :
*or use a dynamic redirect in PHP, just check the request string from teh url and if it is say for instace you find action=search then use the php redirect? http://www.mozilla.org/docs/dom/domr...dow_ref76.html <--- window.open documentation. this is about the 20th edit of this post but... can i see the code you are trying to impliment? |
Quote:
|
| All times are GMT -5. The time now is 11:03 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC