I am in the middle of building a site. On the site there is a pseudo search box that will always direct to the same page no matter what is entered. The code I currently have for the form is <form name="form1" id="form1" method="post" action="http://abc.com/go.htm"> <input type="text" name="textfield" /> <strong><a href="http://abc.com/go.htm">SEARCH</a></strong> </form> Code (markup): Now on go.htm I want to display what was entered in the search box above. Currently I have: <div id="loader"> <div id="title">Searching database for "Whatever was entered in the search box"...</div> <img src="../../start/loader.gif" width="393" height="17" id="loadbar" /> <div id="results"></div> </div> Code (markup): So if "bunnies" was typed in the search box, the loading page would display "Searching database for bunnies..." How would I do this?
In php, use can use session variables to pass input to another page. But for HTML, only way you can pass variable to another page is by using cookies. Though I'm not sure about this. Some one please correct me if I am wrong.
You have to use server side script like PHP or ASp.net or JSP to take the value from one page to other. because you just dont want to take value from one to other page but I am sure you want to process that value too. By processing i mean you will search database for searched keyword or you will gather data and insert to database. for all this, you need to use above languages.
I actually don't need to process the variable. This isn't a true search function, just a pseudo page to make the site feel deeper than it really is. All I need to do with the variable is display it on the following page. I don't mind using php or javascript. Just need someone who can code better than I to give some guidance.
Hey, I was bashing my brains against this all week until I came accross this site h**p://www.htmlgoodies.com/beyond/javascript/article.php/3471111 You will have to fix the http above cause I dont think I am allowed to post links yet. It totally worked for me and I just altered fields and certain texts. Maybe this can help ~eric