JavaScript - Faq Tree Search
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 Similar TutorialsHi, need help in making a check box list menu, wherein when initial check box is clicked another checkbox will appear. Help Help Hello I am trying to create a family tree, parents / grandparents etc, of a single person... My database etc is already working but I cannot find any working examples that I can make sense of... Each of my records has a name, dob and id of each parent.... How can I get X generations from this.. I thought something like this might work.. GetParents For each parent GetParents And so on... But I have no idea how to put this into code... Any suggestions to put me on the right line would be greatly appreciated Thanks Hi all. I'm experiencing an issue with dijit.Tree/ForestStoreModel/ItemFileWriteStore and I just can't seem to figure out what's going on. If I start with an empty store model ... var myData= { "identifier" : "id", "label" : "name", "items" : [] }; var myStore = new dojo.data.ItemFileWriteStore({ data: myData }); var myModel = new dijit.tree.ForestStoreModel({ sto masterStore, query: {type: 'task'}, rootId: "tasks_id", rootLabel : "Tasks", childrenAttrs: ["children"] }); If I eventually execute newItem on the store, the tree is not updated. myStore.newItem( { id: "2", name : "someName2", type : 'task', children : [], } ); However, if during declaration of my data, I include 1 item, ie. var myData= { "identifier" : "id", "label" : "name", "items" : [ {"id" : "1", "name" : "someName", "type" : "task"} ] }; Then I can subsequent call newItem as many times as I wish, and the tree is updated correctly. If anybody has any ideas, I'm all eyes. Hi, I am really in a slump right now... I thank all of the people who have helped me in this site... i have a script already that allows check boxes to show the next checkbox using the onclick function. and now I cannot figure out how to make a decision tree.. eg. a person will call or ask for 4 possible inquiries.. billing leads to 2 scenarios - the caller wants the charges explained; once explained its good - the caller wants the charges cancelled technical leads to 2 scenarios -the caller asks for technical assistance; hence resolved -the L1 tech cannot resolve the problem and escalates it to a higher dept gen inq leads 3 scenarios - sell the product - higher department cannot locate any account - declines the sale cancellation leads to 2 scenarios - with refund - no refund i am thinking of a combo box for this to make things much easier.. but it is not.. the hard part for me is when the last check box is clicked I want this drop down shown then, after the user selects the any of the scenarios another check box appears and then another one to finish the process. also I had a script were in all the selected values can be copied to a clipboard but, doesnt copy it. I am really really depressed about this.. I want to learn the js. but I am stuck with the level 0 degree.. please help me.. I would like to put a script on our website that users could interact with and that would ask a series of questions and based on those questions propose answers. Im surprised I cant find much on the web to help me do this. Does anyone know a PHP script, widget, or template that could provide me this functionality? I just want to be able to input a series of questions and answers and the logical flow and be able to host it on our web server. I need to render a tree in freemarker. I am not sure about what technology should be used. I was thinking Jquerys jsTree plugin. My requirements - 1. Tree control -Name and instead of Icon ,i want customized letters(A,B,C) that represents type of element. 2.I dont want dotted lines connecting root and children like folder tree. 3.collapsable. Please suggest what and how can i do .? woundering if any could point me in the right direction, where i can find a soul tree canculator script or any one who can make one. thanks shaun. Code: <script type="text/javascript"> function validate(form) { // Checking if at least one period button is selected. Or not. if (!document.form1.sex[0].checked && !document.form1.sex[1].checked){ alert("Please Select Sex"); return false;} var total="" for(var i=0; i < document.form1.scripts.length; i++){ if(document.form1.scripts[i].checked) total +=document.form1.scripts[i].value + "\n" } if(total=="") alert("select scripts") else alert (total) return false; } </script> <table border='0' width='50%' cellspacing='0' cellpadding='0' ><form name=form1 method=post action=action_page.php onsubmit='return validate(this)'><input type=hidden name=todo value=post> <tr bgcolor='#ffffff'><td align=center ><font face='verdana' size='2'><b>Sex</b><input type=radio name=sex value='male'>Male </font><input type=radio name=sex value='female'><font face='verdana' size='2'>Female</font></td></tr> <tr><td align=center bgcolor='#f1f1f1'><font face='verdana' size='2'><b>Scripts You know</b><input type=checkbox name=scripts value='JavaScript'>JavaScript <input type=checkbox name=scripts value='PHP'>PHP <input type=checkbox name=scripts value='HTML'>HTML </td></tr> <tr bgcolor='#ffffff'><td align=center ><input type=submit value=Submit> <input type=reset value=Reset></td></tr> </table></form> In this code a checkbox is accessed as "document.form1.scripts[i].checked" If we see the tree view of this document, it is "table/form1/tr/td/scripts[i].checked" SO are we not required to add table elements in the path to the checkbox ? I guess its not required. But why ? Because cell, row and table are the parent elements in HTML tree, then why are they not required ? Code: oaktree.addItem("RC Mail", branch1, "rcmail/") //Add this item to branch2 I can open it up in the current page, but the menu is in a frame and I need to open it in a fram called "home". How can I do that~?? Hello, I have a specific need in javascript. Can I be guided in this context if its possible or not??? I am using virtuemart extension in joomla to make an ecommerce website. I will try to explain my requirement with the example. Following is the sample category tree with number. 1.0 .....1.1 ..........1.1.1 ..........1.1.2 .....1.2 ..........1.2.1 ..........1.2.2 .....1.3 ..........1.3.1 ..........1.3.2 2.0 .....2.1 ..........2.1.1 ..........2.1.2 .....2.2 ..........2.2.1 ..........2.2.2 .....2.3 ..........2.3.1 ..........2.3.2 Now I have a drop down main menu as 1.0 and 2.0. I want that when i click on 1.0 all the nodes of 1.0 should be opened and 2.0 should be closed and similarly when i click on 2.0 all its child nodes should be opened and 1.0 should be closed. What happen with most extensions is that at a time only one child is opened. If i click on 1.0 then only 1.1 or 1.2 or 1.3 will remain open at a time. Does this kind of customization can be done or is available in javascript .... I hope i will be helped... Thanks a lot for the time. 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. I am having trouble with a sub-menu of the 1st item only and can not seem to figure it out. All the others are fine. Any help is appreciated. Here is the code: var NoOffFirstLineMenus=7; // Number of first level items var LowBgColor='white'; // Background color when mouse is not over var LowSubBgColor='white'; // Background color when mouse is not over on subs var HighBgColor='black'; // Background color when mouse is over var HighSubBgColor='black'; // Background color when mouse is over on subs var FontLowColor='black'; // Font color when mouse is not over var FontSubLowColor='black'; // Font color subs when mouse is not over var FontHighColor='white'; // Font color when mouse is over var FontSubHighColor='white'; // Font color subs when mouse is over var BorderColor='black'; // Border color var BorderSubColor='black'; // Border color for subs var BorderWidth=1; // Border width var BorderBtwnElmnts=1; // Border between elements 1 or 0 var FontFamily="arial,comic sans ms,technical" // Font family menu items var FontSize=9; // Font size menu items var FontBold=1; // Bold menu items 1 or 0 var FontItalic=0; // Italic menu items 1 or 0 var MenuTextCentered='center'; // Item text position 'left', 'center' or 'right' var MenuCentered='center'; // Menu horizontal position 'left', 'center' or 'right' var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static var ChildOverlap=.2; // horizontal overlap child/ parent var ChildVerticalOverlap=.2; // vertical overlap child/ parent var StartTop=05; // Menu offset x coordinate var StartLeft=05; // Menu offset y coordinate var VerCorrect=0; // Multiple frames y correction var HorCorrect=0; // Multiple frames x correction var LeftPaddng=3; // Left padding var TopPaddng=2; // Top padding var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL var MenuFramesVertical=1; // Frames in cols or rows 1 or 0 var DissapearDelay=1000; // delay before menu folds in var TakeOverBgColor=1; // Menu frame takes over background color subitem frame var FirstLineFrame='navig'; // Frame where first level appears var SecLineFrame='space'; // Frame where sub levels appear var DocTargetFrame='space'; // Frame where target documents appear var TargetLoc=''; // span id for relative positioning var HideTop=0; // Hide first level when loading new document 1 or 0 var MenuWrap=1; // enables/ disables menu wrap 1 or 0 var RightToLeft=0; // enables/ disables right to left unfold 1 or 0 var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover var WebMasterCheck=0; // menu tree checking on or off 1 or 0 var ShowArrow=1; // Uses arrow gifs when 1 var KeepHilite=1; // Keep selected path highligthed var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height function BeforeStart(){return} function AfterBuild(){return} function BeforeFirstOpen(){return} function AfterCloseAll(){return} // Menu tree // MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width); // For rollover images set "Text to show" to: "rollover:Image1.jpg:Image2.jpg" Menu1=new Array("Home","","",3); Menu1_1=new Array("The Ayllu","The Ayllu.htm","",0,20,150); Menu1_2=new Array("Acknow","Acknowledgement.htm","",0); Menu1_3=new Array("Prayer","Prayer.htm","",0); Menu2=new Array("About Us","","",4); Menu2_1=new Array("Debra","bio.htm","",0,20,150); Menu2_2=new Array("Seamus","Seamus.htm","",0); Menu2_3=new Array("Locations","location.htm","",0); Menu2_4=new Array("Contact Us","contact.htm","",0); Menu3=new Array("Services","","",7); Menu3_1=new Array("Shamanic Healing","http://www.Ayllu.us/Shamanic Healing.htm","",0,20,150); Menu3_2=new Array("Shamanic Counseling","http://www.Ayllu.us/Shamanic Counseling.htm","",0); Menu3_3=new Array("Sacred Ceremonies","http://www.Ayllu.us/Sacred Ceremonies.htm","",0); Menu3_4=new Array("Sacred Body Work","http://www.Ayllu.us/sbw.htm","",0); Menu3_5=new Array("Full Moon Crystal Bowl","http://www.Ayllu.us/fm.htm","",0); Menu3_6=new Array("Sound Healing","http://www.Ayllu.us/Sound Healing.htm","",0); Menu3_7=new Array("LaHo-Chi","http://www.Ayllu.us/lahochi.htm","",0); Menu4=new Array("Calendar","http://www.ayllu.us/calendar.htm","",0); Menu5=new Array("Gallery","http://www.ayllu.us/gallery.html","",0); Menu6=new Array("Articles","","",3); Menu6_1=new Array("Test 1","http://www.Ayllu.us/blank.htm","",0,20,150); Menu6_2=new Array("Test 2","http://www.Ayllu.us/blank.htm","",0); Menu6_3=new Array("Test 3","http://www.Ayllu.us/blank.htm","",0); Menu7=new Array("Links","http://www.ayllu.us/links.htm","",0); 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. 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'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> Hi, I am trying to make a search box...like the one Bing has...i am able to make one successfully..but the thing is i want to display the text inside the box..the one like Google custom search has...I am sure this is possible but just dont know how to make it work ...can you help me with the script or the links which can help me make a search box which displays text inside.... Thanks in Advance |