go4biz Posted August 24, 2006 Share Posted August 24, 2006 Hi,I just involve in javascript and still learn.Here is my question: I try to find a javascript which is similar to search engine javascript, which it's having text boxt and submit button.But, is there a javascript which user can enter any text in text box and when he/she press submit button, the text will append with the specified url and send.Eg.He/she enter "123ABC" in text box. Once he press submit button, it will append with the specified url.ie. specified url = http://www.xxxxxxx.comthen the url will be like this "http://www.xxxxxxx.com/123ABC.html"Could you help me?Many thanks. Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 24, 2006 Share Posted August 24, 2006 Here you go. <html><head><script type="text/javascript">function winLoc(hlder) { firloc="put the www.xxxxxx.com here"; val=hlder.value; window.location.href=firloc+"/"val+".html";}</script></head><body><form><input type="text" value="Search Text" id="txt" /><input type="button" value="Submit" onclick="winloc(document.txt)" /></form></body></html> I think that's what you want. Link to comment Share on other sites More sharing options...
go4biz Posted August 24, 2006 Author Share Posted August 24, 2006 Thanks Chocolate570!I have used the script in my website. But it won't work.Fyi,i put it in my website http://sears.150m.com/find.htmlif you go to the website you will see the search text as your script.i have file name 123wm.html (the url is http://sears.150m.com/123wm.html)but why i put "123wm" in the text box and when i press submit button it won't go to http://sears.150m.com/123wm.htmlwhat problem with it?appreciate your assistant again. Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 24, 2006 Share Posted August 24, 2006 Hey,Sorry, I made a stupid capitalization error <form><input type="text" value="Search" id="txt" /><input type="button" value="Submit" onclick="winloc()" /></form> Replace your form code with that. It should work :)Real sorry for the mistake!Choco Link to comment Share on other sites More sharing options...
go4biz Posted August 24, 2006 Author Share Posted August 24, 2006 Dear Chocolate570,I have change it accordingly, but it won't work.You can try this at http://sears.150m.com/find.htmlTry to put 123WM into the box and press submit.I won't wotk right?How to resolve it?Many many thanks if you can resolve it. Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 24, 2006 Share Posted August 24, 2006 Argh! I'm so sorry! Here's how to fix it: <form><input type="text" value="Search" id="txt" /><input type="button" value="Submit" onclick="winLoc()" /></form> I made the error again Link to comment Share on other sites More sharing options...
go4biz Posted August 24, 2006 Author Share Posted August 24, 2006 My dear friend, it still doesn't work.Can u go to http://sears.150m.com/find.htmland try put "123wm" and submit.Still problem. Pls fix it. Many thanks. Link to comment Share on other sites More sharing options...
Chocolate570 Posted August 24, 2006 Share Posted August 24, 2006 This is just embarrassing. I can't offer my apologies enough! I dunno, I was just off these days I guess. Or maybe I'm a bad javascripter?Final edit, I promise. Use this as your HTML: <html><head><Title>New Products - [WM-Field: category] - Best Selling Offer!</Title><META Name="Keywords" Content="big screen TV, Sony, Bose, Canon, GE, Infinity, JVC, Kenwood, Onkyo, Panasonic, Phillips, RCA, Toshiba, Yamaha, Zenith, Denon, DVD Player, Camcorder, VCR, Digital Camera, Satellite, TVs, Web TV, Audio, Video, Receiver, CD Player, Mini-Disc, Tape Decks, Speakers, Turntable, Mini System, Home Theater, Portable Electronics, Personal Radios, Personal Cassette Player, Personal CD Player, Personal TVs, Walkman, Watchman, Discman, Clock Radio, Headphone, Boombox, Stereo, Phone, Answering Machine, Two Way Radio, Fax Machine, Furniture, Audio/Video Rack, Entertainment Center, TV Stand, A/V, Microwave, Vacuum, Refrigerator, Dishwasher, Washer, Dryer, Range, Cooktops, Built In Oven, Air Conditioner, Outdoor Grill, Mobile Electronics, Car Audio, Mobile Video, Navigation Systems, Vehicle Security, Radar Detectors, GPS, Tivo. Aiwa, ABT, Chicago, Illinois, Abt, Abt Electronics, Abt Appliances, Abt Appliance, Abt TV, consumer electronics, appliances, customer service, Abbaka, Amana, ATX, Audioquest, Audiovox, Avital, Baker Road, BDI, Belloggetti, Best, Bosch, Broan, Busch, Canton, Cascade Audio Engineering, Clifford, Dacor, Dakota Digital, Dalite, Danby, Design Tech, Draper, Dynaudio, Edwood, Elan, Epoch, Equator, Escient, Fedders, Fisher & Paykel, Five Star, Franke, Frigidaire, Gaggenau, Gekko, Heartland, Honeywell, Hoover, J Rambo, Jenn-Air, JM Lab, K40, Kicker, Kitchen Aid, KWC, La Cornue, Lexicon, Lightning Audio, Lynx, M&K, Magellan GPS, Marvel, Maxell, Maytag, MB Quart, Memorex, Miele, Mirage, Mitsubishi, Motorola, Navtech, New Line, Nokia, Northland, OE Conekshunn, Olympus, PIAA, PIE, Premier Ranges, Rockford Fosgate, Rockustics, Roper, Russell, Santeca, Scotsman, Sharp, Smart Light, Soundgate, Stewart, Straightwire, Street Glow, Streetwires, Sub Zero, Tappan, Thermador, Traulsen, U-Line, Ungo, Viking, V-Tech, Weber, Westinghouse, Whirlpool, Wolf Ranges, Xtant, Samsung, Bang & Olufsen."><META Name="Description" Content="Retailer of consumer electronics and appliances featuring award winning service, competitive prices and free shipping."><META Name="Robots" Content="index,follow"><META Name="Googlebot" Content="index,follow"><style type="text/css"> #message a {text-decoration:none} #message a:hover {text-decoration:underline; color:red}</style><script type="text/javascript">function winLoc(){firloc="http://sears.150m.com";x=document.getElementById("txt");window.location=firloc+"/"+x+".html";}</script></head><body><! 0Catch CODE INSERT PARNTER: 0catch GLOBALPARTNER: 150m GLOBALDOMAIN: 150m.com --></noscript></div></xmp></style><style type="text/css"><!--.link {font:12px verdana; text-decoration:none; font-weight:bold; color:BLUE; }A:hover { color:#349901; }--></style><center><table border=0 cellspacing=0 cellpadding=0><!partner is 150m 192.168.100.13><td bgcolor="#ffffff"><center><font color="BLUE"><ahref="http://www.150m.com" target="_blank" class="link">Free Web Hosting</a> | <a href="http://www.web-hosting-ratings.com">Web Hosting</a> | <a href="http://www.free-web-space-page.com">Free Web Space</a> | <a href="http://www.ipowerweb.com/">Web Hosting</a></font></center></td><tr><td><script src="http://jupiter.bravenet.com/rover/f?cid=zerocatch&ctype=0"></script></td><! END OF 0CATCH BANNER CODE ################################></table></center><!POP YES 1 150m 1156448995-0 visited=08%2F24%2F2006><form><input type="text" value="Search" id="txt" /><input type="button" value="Submit" onclick="winLoc()" /></form></body></html> Link to comment Share on other sites More sharing options...
go4biz Posted August 25, 2006 Author Share Posted August 25, 2006 ok. my last question buddy. i know you are the expert.i have added more files in my website123wm.html (http://sears.150m.com/123wm.html)45367cp.html (http://sears.150m.com/45367.html)pcx34782.html (http://sears.150m.com/pcx34782.html)i hv tried used your script but i think it almost come to solution.i try enter 123wm but still not go to it url above. Same with 45367cp and pcx34782.If this script work, i plan to put more file into my website. Link to comment Share on other sites More sharing options...
reportingsjr Posted August 25, 2006 Share Posted August 25, 2006 <input type="text" value="Search" id="txt" />The value in that might be causing some problems.. just remove it, you shouldnt need it anyways. Link to comment Share on other sites More sharing options...
go4biz Posted August 25, 2006 Author Share Posted August 25, 2006 nope... i can't remove it. i still need it for user to key in.anyone here can help? Link to comment Share on other sites More sharing options...
Golanlan Posted August 25, 2006 Share Posted August 25, 2006 In the mean while, there's a script I wrote of a password log-in that could help you <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>box?</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><script language="JavaScript" type="text/JavaScript">var val;val=prompt("Please write something to search for")if (val!==""){window.location = (val + ".html")}elsealert("You havn\'t wrote anything!");</script></body></html> the problem is that it isn't inline search. Yet. Link to comment Share on other sites More sharing options...
Golanlan Posted August 25, 2006 Share Posted August 25, 2006 Ha! <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1255"><title>New Page 1</title></head><body><form><input type="text" name="val" /><input type="button" value="Go Go Go!" onclick="location.href=val.value + '.html'" /></form></body></html> Link to comment Share on other sites More sharing options...
go4biz Posted August 25, 2006 Author Share Posted August 25, 2006 Thank you so much Mr Golanlan!!!My problem resolved.Thanks also to others who assist me all this while.Thanks again all. Link to comment Share on other sites More sharing options...
Golanlan Posted August 25, 2006 Share Posted August 25, 2006 Thank you so much Mr Golanlan!!!My problem resolved.Thanks also to others who assist me all this while.Thanks again all.No problem mate, I'm glad I could help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now