JavaScript - Tips On What I Am Meant To Search For Please
Hi,
I can;t think what to search for but I need the following. I am running a form and if data is entered to the first text box, I want a warning message to show up, if they try to add data to any one of several other textboxes. tips on search terms would be great or a link to what might be some loosely appropriate code. bazz Similar TutorialsHello all, I have written a javascript code to take the users Zip-Code, and make an alert come up with minimum purchases for free delivery. However, I have made this backwards from what I really need. I need an On-Load alert so customers can set their Zip-Code, and then print into a div the information needed. I also need this to store a cookie so the customer will not be forced to enter their information on every page visit. I have included a truncated portion of the script (it is over 850 lines) Code: function message() { zipcode = document.ZipCode.txtZip.value if (zipcode == 33820) { alert("Minimum purchase for delivery: $300.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} else if (zipcode == 33920) { alert("Minimum purchase for delivery: $235.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} else if (zipcode==34216) { alert("Minimum purchase for delivery: $150.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} else if (zipcode==33572) { alert("Minimum purchase for delivery: $150.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} else if (zipcode==32712) { alert("Minimum purchase for delivery: $300.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} else if (zipcode==34679) { alert("Minimum purchase for delivery: $150.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} else if (zipcode==33823) { alert("Minimum purchase for delivery: $300.00" + '\n' + "For smaller orders, please visit Packitright.com at:" + '\n' + "http://packitright.com")} Any assistance would be greatly appreciated. Okay so as you could tell by the unfamiliar name, I am a newbie. I have completed the codeacedmy Javascript course and while I know it's not the best for actually getting GOOD at at, it's still taught me a bit. I'm, working with a buddy of mine who is urging me to begin working on something ASAP so that we can start a project together. I suggest making a short RPG, but I'm unsure how I can begin with something like that and what I would need to work on. Or if you have any other projects you can suggest as a good first project to get my feet wet I would be extremely grateful for the help. Thanks in advance!
Hello, I'm new to this forum. I want to improve my ability to write JavaScript and am looking for a friendly place to find some constructive criticism and suggestions on my code. This script does not have any practical use (that I can think of); it calculates prime numbers. It is just an exercise. I am looking for suggestions on all aspects from the CSS/aesthetics to the HTML and of course the JavaScript. I posted the script here. One definite thing that bugs me is the cursor is not in the text field when the page loads. Also it would be better if the user had the option of hitting the return key in addition to the submit button. Suggestions appreciated. Code: <!DOCTYPE html> <html lang="en"> <head> <title>Prime Number Calculator</title> <style type="text/css"> form{ width: 200px; border: solid 3px blue; border-style: double; padding:5px; text-align:center; background-color:#eee; } #title{ text-align:center; border: solid 1px blue; background-color:#fff; margin:5px; padding:0px; } </style> <script src="jquery.js" type="text/javascript"></script> <script type="text/javascript"> var candidates = new Array(); function calculatePrimes(form){ var max = form.input.value; //Check to make sure input is a number if(isNaN(max)){ alert("Dude, you must enter a number!"); } for(i=2; i<=max; i++){candidates[i]=i;} var i=2; for(i=2; i<Math.sqrt(max); i++){ if (candidates[i]!=0){ var j=i*i; while(j<max){ candidates[j] = 0; j=j+i; } } } //Pull the primes out of the candidates i=2; var primesOut = ""; for(i=2; i<max; i++){ if(candidates[i]!= 0){ primesOut = primesOut + ((i>2)?", " : "" ) + candidates[i]; } } form.output.value = primesOut; } </script> <head> <body> <form> <h2 id="title">Prime-Number Calculator</h1> Check up to:<input type="text" name="input" size="5" value="100" \> <br /> <textarea rows="5" cols="20" name="output"></textarea> <input name="calc" value="Find!" type=button onClick="calculatePrimes(this.form)"> </form> </body> </html> Hello Coding Forums, I am working on building a watch app for the Pebble smartwatch that works in combination with a Bluetooth light bulb that could trigger on and off functionality. I have bits of the source code from a the same bulb project someone started from another site that is coded Java, so I imported them into cloud pebble their java library. I've been working on this since last year and I'm wondering what at all could I be doing wrong. I get the "cards" to show up, but as far as a connection to the bulbs I have not established that yet. I've attached my source code and if anyone has any time to give me some pointers that would be appreciated massively. I know that Hubble worked on a similar project, to control lighting from a pebble smartwatch so I know it can be done. I've even tested this code with other developers who are experienced and they are also wondering why the connection does not take place. It would be really neat if I got this to work. Thank you everyone. Attached Thumbnails In this case, Let's take Google Search as example: The code is JScript .NET, which is basically a .NET version of Javascript. Regardless of language, Anyone with appending type of skill can answer my question. This code is used in Fiddler(It's a Man-in-the-middle proxy) Code: if (oSession.uriContains("&q=")) // oSession is a Fiddler object session // uriContains() function, checks for case-insensitive string from the URI { var str = oSession.fullUrl; var sAppend = "test1+test2+test3"; if (!oSession.uriContains(sAppend)) { oSession.fullUrl = str.replace( "&q=","&q="+sAppend); } } For those who are confused, It says, If &q= is present in the URI, replace/append &q= with &q=test1+test2+test3 Problem: It appends test1+test2+test3 instantly, when it sees &q= in the URL. Basically, how do I make it wait until I click the submit/search button Thank you. Update: I heard about Onsubmit() event, but not really familiar with it. How do I use it? like, should I go to google source page and edit the form id? Also, Any other methods besides Onsubmit()? Hi Everyone! I have a website that I'm designing where I have the need to search multiple sites at specific times. By this I mean that In some cases, we would want to search only the internet using google, or only search the site that I've created (which currently uses the jse_search.js solution), or only our company's website. I currently have four different search boxes that will search either the internet, the internal site, a separate internal site, or a third-party website, which all working fine. The problem is that the search boxes take up quite a bit of space, and the layout is becoming cumbersome. Is there a way in Javascript I could use a single search box and a drop-down list to select which method to use? The code I'm currently using is below. With the exception of the Google search function, I've modified some of the site names to general site names and paths to preserve the company's anonymity: Code in the <head> tag: Code: <script language="JavaScript1.3" type="text/javascript" src="jse_form.js"> </script> Code in the <body> tag: Code: <!--Begin Internal Site Search 1!--> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td><form name="jse_Form" onsubmit="search_form(jse_Form);return false"> <input type="text" name="d" size="30"> </tr></td> <tr><td> <input type="button" value="Internal Site Search 1" onclick="search_form(jse_Form)"> </form> </tr></td> </table> <!--End Internal Site Search 1!--> <!--Begin Internal Site Search 2!--> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td> <!--webbot bot="Search" S-Index="all" S-Fields S-Text="Search for:" I-Size="20" S-Submit="Start Search" S-Clear="Reset" S-TimestampFormat="%m/%d/%Y" TAG="BODY" b-useindexserver="1" startspan --> <form action="http://sitesearch2.idq" method="POST"><input type="text" name="UserRestriction" size="30" value> </tr></td> <tr><td style="text-align: center;"> <input type="submit" value="Internal Site Search 2"></form> </form> <!--webbot bot="Search" i-checksum="4210" endspan --> </td></tr> </table> </div> <!--End Internal Site Search!--> <!--Begin Google Search!--> <form method="get" action="http://www.google.com/search"> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td> <input type="text" name="q" size="30" maxlength="233" value="" /> </tr></td> <tr><td align="center"> <input type="submit" value="Google Search" /></td></tr> </table> </div> </form> <!--End Google Search!--> <!--Begin Third Party Search!--> <form id="keywordSearchForm" method="get" action="http://www.site3.html"> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td> <input class="input" type="text" name="keyword" size="30" /> </tr></td> <tr><td align="center"> <input type="hidden" name="origin" value="keywordsearch" /><input id="go" class="button" tabindex="0" type="submit" value="Third Party Search" /> </td></tr> </table> </div> </form> <!--End Third Party Site Search!--> Hi experts, is it possible via Javascript to search certain websites with certain keywords without having to use specific search engines? example search only the following: 1. www.yyy.com 2. www.aaa.com 3. www.zzz.com for the keyword "Laminat" and open the sites accordingly. thx Hello people. I'm looking to create a simple search engine capable of searching multiple search engines simultaneously together (e.g. Google, Bing, Yahoo, etc.) and then displaying the results below for all sites on the same page. I don't want each search engine results page opening up in individual windows or anything, nor do I want people to have to manually select the search engine to search with. Just a single page where a user types in something, pressed [Enter] and then presented with all results from multiple sites on one page (without duplicates). I'm also looking to do this with image and torrent sites, etc. How would I go about doing this? Thanks a million guys. You have bigger brains than me. Good Day: I am building a small website that lists the local restaurants in the area. I would like to have a search bar at the top of the page so the user could type in the name of the restaurant and it takes you to my review. The way I have it set now, is the user has to scroll down to find the restaurant. The saerch bar would be much easier. Thanks in advance for any and all assistance. I have my own multi option search bar html Code: <form name="searchform" action="http://www.google.com/search?q=" onsubmit="return dosearch();"> Search: <select name="sengines"> <option value="http://www.google.com/search?q=">Google</option> <option value="http://search.yahoo.com/search?q=">Yahoo</option> <option value="http://www.bing.com/search?q=">Bing</option> <option value="http://www.playlist.com/searchbeta/tracks#">Playlist</option> <option value="http://www.youtube.com/results?search_query=">Youtube</option> <option value="http://www.hulu.com/search?query=">Hulu</option> <option value="http://www.tv.com/search.php?type=11&stype=all&tag=search%3Bfrontdoor&qs=">TV.com</option> <option value="http://www.ask.com/web?q=">Ask</option> <option value="http://www.answers.com/topic/">Answers</option> <option value="http://www.ehow.com/search.aspx?s=">eHow</option> <option value="http://en.wikipedia.org/wiki/">Wikipedia</option> <option value="http://search.forbes.com/search/find?tab=searchtabgeneraldark&MT=">Forbes</option> </select> For: <input type="text" name="searchterms" /> <input class="button" type="submit" name="SearchSubmit" value="Search" /> </form> javascript (external) Code: function dosearch() { var sf=document.searchform; var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value); window.location.href = submitto; return false; } but I want to have a second drop-down menu. I just can't get the 2nd one have everything still work. Can some benevolent sheep-guider-person (whatever they're called) help me? Thanks in advance, man with unnecessary phallic staff. Ive been using js scripts for purposes of place links and banners randomly on web pages. Thing that is troubling me is that the links that are seen on page and not seen in the source code. Also, "spider view" tools that show the content and links are not seen/found by search engines, seems to suggest that links and anchor text is not seen by the crawler agent... Seems unlikely to me that the crawlers do not correctly register or index either the text or the link when ranking and listing the page content. ?? Can someone that knows describe what the situation is with regard to js and whether i should switch to php and server side includes to ensure that the links and anchor text is correctly registered. thanks.... i have a site where i sell vinyl graphics. i dont really want to use a full ecommerce CMS so search that way is out of the question. basically what i want is a search box where the user can type in keywords and it will display a page exactly like my products page but only showing products that are associated with that keyword. what would be the best way to go about doing this or is more than JS going to be needed?
Hello, I have a search textbox field which populates the results in a dropdown after searched. But there is no way, to let users to explain to click or use the dropdown to see the results.. thus, I would like to have a focus on the dropdown, so after the user searches through the search textfield, and enter, the dropdown gets the focus so it will user friendly. can anyone help me on this. thank you in advance The point is to type something like votillity.com and get votillity.com or google.com and get google.com HTML Code: <form name="searchformHTTP" action="HTTP()" onsubmit="return HTTP();"> <input style="position:fixed;top:0;left:49.15%;width:10%;" type="text" name="searchterms"/> <input class="buttonsearch" style="position:fixed;top:0;left:59.6%;" type="submit" name="SearchSubmit" value="!"/> <select name="HTTPops" style="position:fixed;top:0;left:61.7%;width:6%;"> <option value=".com">.com</option> </select> </form> (external) javascript Code: function HTTP() { var sfHTTP=document.searchformHTTP; var op=document.option[sfHTTP.HTTPops.selectedIndex]value; window.location.href = "http://"+sf.searchterms.value+"op"; return false; } Hi How can I use this code so that it searches for multiple strings? if(document.URL.indexOf("strings here") > 0){ Regards Mark I am using javascript to search for the '*' character in a string (ie. 'username*:') but using search('\*') does not work. How do I search for it since the search function takes a regexp argument and * messes that up?
Hi all, I'm looking to find a way to making a FAQ selection search which has a hierarchy effect. For example: Whats your favorite color? Red Blue Green Say you select red What shade of red do you prefer? Dark Light Say you select Light Final page that will contain the information that you had rounded down through the search. Does any one have any ideas on how I can do this as I cant seem to find anything on the net! Thanks First off please forgive my ignorance, as I am very new to coding. I hope that I have posted this in the right place. I found a great piece of code that I would like to use for my site search. I found it he http://www.javascriptkit.com/script/...e_search.shtml Here is what I am attempting to do. I would like this piece of code to search all three of my domains, if this is possible. I would like to use this search box on all three of my websites, if this is possible. If you look at this site: www.kennedyassassinationresearch.com I would like to keep the look similar to what it is now, and use this code in the upper right corner of the header, where the black search box is now. Is any of this possible? the code I located is: Code: <form name="jksearch" action="http://www.google.com/search" method="get" onSubmit="jksitesearch(this)"> <p>Search JavaScript Kit:<br /> <input id="hiddenquery" type="hidden" name="q" /> <input name="qfront" type="text" style="width: 200px" value="navigator object" /> <input type="submit" value="Search" /><br /> <div style="font: bold 11px Verdana;">Google:<input name="se" type="radio" checked> *Yahoo:<input name="se" type="radio"> *MSN:<input name="se" type="radio"> </div> <script type="text/javascript"> // All-in-one Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/ // This notice must stay intact for use //Enter domain of site to search. var domainroot="www.javascriptkit.com" var searchaction=[ //form action for the 3 search engines "http://www.google.com/search", "http://search.yahoo.com/search", "http://search.msn.com/results.aspx" ] var queryfieldname=["q","p","q"] //name of hidden query form for the 3 search engines function switchaction(cur, index){ cur.form.action=searchaction[index] document.getElementById("hiddenquery").name=queryfieldname[index] } function jksitesearch(curobj){ for (i=0; i< document.jksearch.se.length; i++){ //loop through radio to see which is checked if (document.jksearch.se[i].checked==true) switchaction(document.jksearch.se[i], i) } document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value } </script> </p> </form> <p style="font: normal 11px Arial">This free script provided by<br /> <a href="http://www.javascriptkit.com">JavaScript Kit</a></p> Any help is greatly appreciated, as this is a learning experience for me, and this has me quite confused. Thanks! I'm doing some kind of MP3 Player search in javascript form using the URL from http://beemp3.com/index.php?p= then after the = any user will type the song they want to search and it'll appear as a valid URL search data under beemp3.com. The page is in http://stereowired.wehostyour.info/searchid.html. My problem is getting the value in .superform whenever the onChange occurs. this.value() doesn't work. I need some kind of alternative thanks oh yeah and the whole code Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>MP3 Search Engine</title> <style type="text/css"> *{font-family:"georgia","times new roman"} body{padding:0;margin:0;background:#fff;color:#000;} .center{text-align:center;width:64%;margin:0 auto;} .formatt{width:100%;height:36px;display:block;} .superform{float:left;width:73%;padding:5px 0;border:2px inset #a0a0a0;background:#e8e8e8;font-size:17px;color:#555;text-align:center;display:block;margin-top:1px;text-shadow:1px 1px 0 #fff;} .superform:hover{background:#d8d8d8} .supersubmit{float:right;width:25%;padding:5px 0;border:2px outset #333;background:#434343;font-size:17px;color:#999;display:block;margin-left:1%;text-shadow:1px 1px 0 #121212;} .supersubmit:focus{border-style:inset;color:#fff} #jam{width:100%;display:block;clear;both;border:0;height:600px;} </style> </head> <body> <div class="center"><h2>Stereo wired Search Engine</h2><div class="formatt"> <input class="superform" type="name" onChange="document.getElementById('jam').src="http://beemp3.com/index.php?q="+this.value()+"" /><input class="supersubmit" type="submit" value="Search" /></div> <iframe id="jam" src="http://beemp3.com"></iframe></div> </body></html> Hey guys, im in need of some more java script help (by the way thanks for all the other times you guys have helped me) need to create a search box that whatever is in the search box will come up at the end of the URL https://****/DirectConnect/Getpremie...Chassis|X##### the last 6 charecters should be replaced with what ever number that in the search box so X##### should be replaced by 123456 for example or any other number |