JavaScript - Quick Search Action On Multiple Tables
Hi
I'm using quick search plugin (www.dynamicdrive.com) in filtering rows in a group of tables. The problem is that the old vesion of Quick search may act on multiple tables as long they have the same table_id while the new vesion acts on the first table only. Is there a way to solve this problem? N.B. 1-the number of tables is very large (in some pages may be 500 tables). 2-the action of Quick search is applied automaticaly as the user type any text in the input text box. so i don't know any way to make a loop to call the function once for each table. Thanks for your help. Similar TutorialsHello all, I am trying to update a site that has a cookie feature enabled so that a certificate can be retrieved later on. I am using a form to collect and put the cookie, but I have to use two buttons to get the information stored and then direct the user on through to the rest of the site. My question is: Can I combine these functions into the same button? I have scoured the web for solutions, but I can't seem to find anyone doing this exact thing. I know that websites do this type of thing all of the time. Here is the code that I am using. I am an html / css person. I am just getting into js. It is ugly, but I'm coping Code: <body> <div id="header"> </div> <div id="main"><br> <h2><SCRIPT LANGUAGE="JavaScript"> cookie_name = "dataCookie"; var YouEntered; function putCookie() { if(document.cookie != document.cookie) {index = document.cookie.indexOf(cookie_name);} else { index = -1;} if (index == -1) { YouEntered=document.cf.cfd.value; document.cookie=cookie_name+"="+YouEntered+"; expires=Saturday, 31-Dec-2011 23:59:59 GMT"; } } </SCRIPT> <FORM NAME="cf"> Enter Your Full Name as you would like it to appear on the completion certificate: <br> <INPUT TYPE="text" NAME="cfd" size="20"> <INPUT TYPE="button" Value="Enter" onClick="putCookie()"> </FORM> <h6>Select Continue to review the information</h6> <FORM METHOD="LINK" ACTION="cookie_2.htm"> <INPUT TYPE="submit" VALUE="Continue with Training"> </FORM></h2> </div> <div id="footer"> </div> </body> 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!--> 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. Hi im using this php code right here for a search function that opens url's in an iframe
PHP Code: $text = $_POST['text']; switch($_POST['engine']) { case 1: for($i=0;$i<strlen($text);$i++) { if($text[$i]==" ") { $text[$i]="+"; } } $data = "http://www.yahoo.com".$text; break; case 2: $data = "http://www.google.com".$text; break; Code: <FORM name="search" ACTION='search.php' METHOD='POST' target="frame"> <input TYPE='text' NAME="text" id="text" class="search" /> <font face="verdana"> <input type='submit' name="submit" value="Go" class="button" /><br /> Select Engine: </font><br /> <select name="engine" size="26"> <option value="1">yahoo</option> <option value="2">google</option> </select> </form> what i want to do is instead of using the option form i want to make clickable tables or divs, that when clicked opens the url in the iframe. can anybody help me with this? How would you create a text field that allows users to select different search engines, and then search their keyword. Essentially what I'm looking for is a something similar to the default multiple search field that you see in Firefox and Safari. At this point in time I have the multiple search feature implemented. But all I really have is a <select> next to a <input>. What I want is something that combines the two. Basically I want the look and feel of Firefox/Safari default multiple search field. Any help would be appreciated. Thanks, is there some way to searching through multiple path or recursively searching through a path (folders and subfolders) using the code below which seems to search only one node in the tree? Many Thanks. there are basically subfolders in \documents and then subfolders therein. i would like to search it therein for all kinds of files/filenames based on "search criteria". one more thing - is it ok/advisable to use active x objects considering most modern browsers have it disabled or give warnings? Code: <script> var Fo =new ActiveXObject("Scripting.FileSystemObject"); var StrOut = new String(); var FileName = new String(); var Extention = new String(); function FindFile(FOo) { var FSo = new Enumerator(FOo.Files); for(i=0;!FSo.atEnd();FSo.moveNext()) { if(FileName == "*" || FSo.item().name.slice(0,FSo.item().name.lastIndexOf(".")).toLowerCase().indexOf(FileName)>-1) if(Extention == "*" || FSo.item().name.slice(FSo.item().name.lastIndexOf(".")+1).toLowerCase().indexOf(Extention)>-1){ StrOut += "<tr "+ ((i%2)? "":"bgcolor=#C4E3F2") +"><td width=50%><font class=find>" + FSo.item().name + "</font></td><td width=25%><font class=find>" + FSo.item().type + "</font></td><td width=50%><font class=find>"+ String(FSo.item().size/(1024*1024)).slice(0,3) +" MB</font></td></tr>"; i++ } } } function Search() { FileName = (search.value.lastIndexOf(".")>-1)? search.value.slice(0,search.value.lastIndexOf(".")):(search.value.length>0)? search.value.toLowerCase():"*"; //Get Searched File Name Extention = (search.value.lastIndexOf(".")>-1)? search.value.slice(search.value.lastIndexOf(".")+1).toLowerCase():"*"; // Get Searched File Extention Name if(path.value.length>0 && Fo.FolderExists(path.value)){ StrOut = "<table border=0 width=100% cellspacing=0>" FindFile(Fo.GetFolder(path.value)); outPut.innerHTML = StrOut+"</table>"; } else alert("Insert Correct Path Address"); } </script> Code: <BODY topmargin="0" leftmargin="0"> <table border=0 width=100% cellspacing="0" style="border-collapse: collapse" cellpadding="2"><tr> <td dir="ltr" bgcolor="#FFD9D9"><b><font face="Verdana" size="2">Filename : </font></b> </td> <td dir="ltr" bgcolor="#C4E3F2"> <input size=50 type=text id=search name=search class="Find"></td> </tr><tr> <td dir="ltr" bgcolor="#C4E3F2"> <p dir="ltr"></td> <td bgcolor="#FFD9D9"><input size=50 type=hidden value="\Documents" id=path name=path class="Find" > <input type=button value="Search" onClick=Search() class="Find"></td> </tr><tr> <td colspan=2 align=left bgcolor="#FFFFFF"><font face=Verdana size=2><b>Search Result</b></font><hr></td> </tr><tr> <td colspan=2 bgcolor="#FFFFFF"><div id=outPut></div></td> </tr></table> </BODY> </HTML> I am having trouble implementing this script. I am not a coder so please give exact, idiot proof advise. :-) Thank You. <script> (function() { var cx = 'user_id:field_id1'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); // This basically takes the value of the radio button (requires jQuery) $("input:radio[name='GCSField']").change(function() { cx = $(this).val(); }); })(); </script> <label for="user1"> <input name=GCSField id="user1" type="radio" value="user_id:field_id1" checked >User Field 1 </label> <label for="user2"> <input name=GCSField id="user2" type="radio" value="user_id:field_id2">User Field 2 </label> <gcse:search></gcse:search> Here is my html. <!DOCTYPE html> <html> <head><meta charset="UTF-8"> <!--[if lt IE 9]><script src=http://html5shiv.googlecode.com/svn/trunk/html5.js></script><![endif]--> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <title>TEST</title> <meta name="robots" content="noindex, nofollow"> <meta name="viewport" content=" width=device-width, initial-scale=1"><meta name="HandheldFriendly" content="true"><meta name="MobileOptimized" content="320"> <style>body{width:100%;max-width:25em;margin-left:auto;margin-right:auto;font-family:Verdana,'Palatino Linotype',Palatino,'Book Antiqua',Arial,Helvetica,sans-serif;text-align:justify;font-size:105%;background-color:#000;background:#000;}p{margin-bottom:1%;}strong{font-size:115%;font-weight:bold;}a{line-height:200%;text-decoration:underline;color:#0007C6;}article{margin: 0 0 1% 0; color:#000;background:#FEE800;background-color:#FEE800; text-align: center;}</style> </head><body> <article> <div><script> (function() { var cx = 'user_id:field_id1'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); // This basically takes the value of the radio button (requires jQuery) $("input:radio[name='GCSField']").change(function() { cx = $(this).val(); }); })(); </script> <label for="user1"> <input name=GCSField id="user1" type="radio" value="011565775292567206849:xkh-s7ljiug" checked >User Field 1 </label> <label for="user2"> <input name=GCSField id="user2" type="radio" value="partner-pub-4173665486685435:n2tml3-z5vf">User Field 2 </label> <gcse:search></gcse:search></div> <div><gcse:searchresults></gcse:searchresults></div> </article> </body></html> Here is the above page off a server TEST Thanks again. http://www.codingforums.com/showthread.php?t=87742 I've been using the advice and code here to start incorporating expanding/collapsing tables into my work, but I'm hitting a little problem. I want to have multiple such tables side-by-side (each headed by a picture and populated by a lightbox, which isn't the issue), but Dreamweaver wants nothing to do with the idea. I don't really even know if it's possible, but if it is I'd like to know what sort of changes I might need to make to achieve it.
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 - Im pretty new to all this! Have created a form on my website, uploaded database to server, but when the form is submitted - instead of opening the property selection, it just lists the Index of /home/properties and files within that folder. Can anyone help me please? Perky
Hi all, Can anyone point me in the right direction for some sample code that when the selection on a checkbox changes, either writes or removes some content? In this instance, when the checkbox is unchecked, I want more table rows and columns written with the relevant data within them. Then when checked, I want this data removed. Many thanks Hi guys. I was wondering if its possible to switch a form action using javascript. Because im trying to have a search field on my main site for my forum and website. By having two boxes underneath my search field so people can select if the want to search my phpbb forum ore my site. Well anyway, mabey switching the form action is not the right approach. Any tips are welcome thanks. OK I basically have a form field called prepend and if someone enters something in there I want it to prepend to my form action="" how can I insert anything into action ="" depending on what is entered I hope this makes sense. I AM SO LOST <script type="text/javascript"> function SearchGo(){ var searchField = document.getElementById("SearchInput"); var url = "http://url" document.location = url + encodeURIComponent(searchField.value); } </script> //field where URL will be entered and needs to be prepended <input type="text" name="prepend"> //form output is here <form name="searchform" target="_blank" action="";> <input type="button" value="Search" onClick="SearchGo();"/> Thanks for all the help Old Pedant. You're nice enough to lend people a hand when you don't have to, and this makes the second or third time you've helped me solve a problem I've had with my website. Thanks so much. So I'm making a page where when someone clicks on the second drop list, then it carrys out a function first, and it calculates it based on what the first droplist is picked. Here's the code I have: Code: <html> <head> <title></title> <script type="text/javascript"> function first() { var gold = 4; var green = 6; var red = 30; var blue = 0; var total = 100; if (calculate.color.GetElementById('gold').select) { var depends = gold/total }; if (calculate.color.GetElementById('green').select) { var depends = green/total }; if (calculate.color.GetElementById('red').select) { var depends = red/total }; if (calculate.color.GetElementById('blue').select) { var depends = blue/total }; if (calculate.choice1.GetElementById('first').select) { calculate.results.value = 1 * calculate.howmany.value * depends; } } </script> </head> <body> <form name="calculate"> <table> <td> I need: <input type="text" name="howmany" /> <br /> My choice is: </td> <td> <select name="color"> <option selected id="gold">Gold</option> <option id="green">Green</option> <option id="red">Red</option> <option id="blue">Blue Charms</option> </select> <br /> <select name="choice1"> <option id="first" onClick="first()"> First </option> </select> </td> </tr> <tr> <td colspan="2" align="center" valign="top"> You will need <input type="text" name="results" /> </td> </tr> </table> </form> </body> </html> Any help is well appreciated. Thanks. Hello guys, so i have a problem. i have a css/div box, and i have a login form. what im tryn to do is make it so that when i login, it it takes whats in the action of the form and shows it in the div box. the div box is like one of those cool popup boxes, it's done by using javascript and css. anyway, the div box works. the login form works. i just haven't been able to figure out how to get it to appear in the div instead of into a new page. so if any1 can help that would be much appreciated! here's my code: Code: <head><link rel="stylesheet" type="text/css" href="main.css" /> <link rel="stylesheet" type="text/css" href="popup.css" /></head> <form name="Login" method="post" action="login/check.php"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td>Username:</td> <td>Password:</td> </tr> <tr> <td><input name="myusername" type="text" class="txt" id="myusername"></td> <td><input name="mypassword" type="password" class="txt" id="mypassword"></td> <td><input type="submit" class="btn" name="Submit" value="Login" onmouseover='this.style.cursor="pointer" ' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'block' "></td></tr> </table> </form> <div id='PopUp'> <br /> <div id="close"> <a id="link" onmouseover='this.style.cursor="pointer"' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'none'"> <span id="span">Close</span></a> </div> </div> Need help adding var target to this form action Would This be correct? var form = inp.form; form.target = "_self"; Code: <html> </head> <script type="text/javascript"> function formop(inp,op) { var form = inp.form; form.action = op + ".php"; var temp = inp.id.split(","); form.id.value = temp[0]; form.FirstName.value = temp[1]; form.LastName.value = temp[2]; } </script> </head> <body> <form method="post"> <input type="hidden" name="id"> <input type="hidden" name="FirstName"> <input type="hidden" name="LastName"> <input type='image' id='show,me,data' onclick=formop(this,'add'); src='static/icon16/add.jpg'> <input type='image' id='show,me,data' onclick=formop(this,'edit'); src='static/icon16/edit.jpg'> <input type='image' id='show,me,data' onclick=formop(this,'delete'); src='static/icon16/delete.jpg'> </form> </body> Hi, I am needing some help with the mootools script. I have uploaded a test page at http://74.52.32.68/~tempcom/slider/ Here is what I am attempting to do. When I click on one of the items (say Landscapes), I want some corresponding text to appear in the green box above. Is this possible? Would it be a javascript? Any sample codes or assistance would be greatly appreciated. Thanks in advance! Hi! I'm using NiftyPlayer (http://www.varal.org/niftyplayer/) to play an mp3 on my website. I'd like it to refresh the page when the song is over (I have some php grabbing songs from a database and choosing the one to play at random). NiftyPlayer has two functions that are probably useful for this. First, if you have a link go to: Code: javascript:alert(niftyplayer('niftyPlayer1').getState()) It will display the current state of the player (stopped, playing, paused, finished). Presumably, a piece of javascript could poll this variable every second, and once it equals "finished", execute the redirect. However, I think this other piece of code included with NiftyPlayer would help even more. In the .js file, it says the following: Code: this.registerEvent = function (eventName, action) { // eventName is a string with one of the following values: onPlay, onStop, onPause, onError, onSongOver, onBufferingComplete, onBufferingStarted // action is a string with the javascript code to run. // // example: niftyplayer('niftyPlayer1').registerEvent('onPlay', 'alert("playing!")'); this.obj.SetVariable(eventName, action); }; So it would appear that I could use something like this to automatically refresh when the song is over: Code: niftyplayer('niftyPlayer1').registerEvent('onSongOver', 'location.reload(true)'); The problem here is that I have no javascript experience and have no idea how to implement either of these ideas. Help? hi, I would like to pop up an edit window when I submit my form, my code below doesn't seem to work?! think my syntax is wrong soemwhere?! Code: function popUpBig(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=360,left = 220,top = 250');"); } <form method="post" name="times"><input type="hidden" name="day" value="Monday" /><a type="submit" class="button" onSubmit="javascript:popUpBig('edit_day.php')" ><span>Edit</span></a></form> |