JavaScript - Unable To Show Full Results If User Tries To View More Results
view the rest of my comments works on the first page but when i extend the search results the rest of the view comments wont expand.
click View all 3 comments and it will show all comments then click more button try to click the view all comments on the next comment and nothing happens but the screen jumping up to the top. http://www.runningprofiles.com/membe...ll_Script.php# Why is this?? What do i need to do to fix it? PHP Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>9lessons Applicatio Demo</title> <link href="frame.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript" src="jquery.oembed.js"></script> <script type="text/javascript"> $(function() { $('.more').live("click",function() { var ID = $(this).attr("id"); if(ID) { $("#more"+ID).html('<img src="moreajax.gif" />'); $.ajax({ type: "POST", url: "http://www.runningprofiles.com/members/shout/data/ajax_more.php", data: "lastmsg="+ ID, cache: false, success: function(html){ $("ol#updates").append(html); $("#more"+ID).remove(); // removing old more button } }); } else { $(".morebox").html('The End');// no results } return false; }); }); $(function() { $(".view_comments").click(function() { var ID = $(this).attr("id"); $.ajax({ type: "POST", url: "../viewajax.php", data: "msg_id="+ ID, cache: false, success: function(html){ $("#view_comments"+ID).prepend(html); $("#view"+ID).remove(); $("#two_comments"+ID).remove(); } }); return false; }); }); $(function() { $(".comment_button").click(function() { var element = $(this); var boxval = $("#content").val(); var dataString = 'content='+ boxval; if(boxval=='') { alert("Please Enter Some Text"); } else { $("#flash").show(); $("#flash").fadeIn(400).html('<img src="ajax.gif" align="absmiddle"> <span class="loading">Loading Update...</span>'); $.ajax({ type: "POST", url: "update_ajax.php", data: dataString, cache: false, success: function(html){ $("ol#update").prepend(html); $("ol#update li:first").slideDown("slow"); document.getElementById('content').value=''; $('#content').value=''; $('#content').focus(); $("#flash").hide(); $("#expand_url").oembed(boxval); } }); } return false; }); //comment slide $('.comment').live("click",function() { var ID = $(this).attr("id"); $(".fullbox"+ID).show(); $("#c"+ID).slideToggle(300); return false; }); //commment Submint $('.comment_submit').live("click",function() { var ID = $(this).attr("id"); var comment_content = $("#textarea"+ID).val(); var dataString = 'comment_content='+ comment_content + '&msg_id=' + ID; if(comment_content=='') { alert("Please Enter Comment Text"); } else { $.ajax({ type: "POST", url: "comment_ajax.php", data: dataString, cache: false, success: function(html){ $("#commentload"+ID).append(html); document.getElementById("textarea"+ID).value=''; $("#textarea"+ID).focus(); } }); } return false; }); // Delete Wall Update $('.delete_update').live("click",function() { var ID = $(this).attr("id"); var dataString = 'msg_id='+ ID; var parent=$("#bar"+ID); jConfirm('Are you sure you want to delete this message?', 'Confirmation Dialog', function(r) { if(r==true) { $.ajax({ type: "POST", url: "delete_comment.php", data: dataString, cache: false, success: function(html){ $("#comment"+ID).slideUp(); } }); } return false; }); return false; }); }); </script> <style type="text/css"> body { font-family:Arial, Helvetica, sans-serif; font-size:12px; } .update_box { background-color:#D3E7F5; border-bottom:#ffffff solid 1px; padding-top:3px } a { text-decoration:none; color:#d02b55; } a:hover { text-decoration:underline; color:#d02b55; } *{margin:0;padding:0;} ol.timeline {list-style:none;font-size:1.2em;}ol.timeline li{ display:none;position:relative; }ol.timeline li:first-child{border-top:1px dashed #006699;} .delete_button { float:right; margin-right:10px; width:20px; height:20px } .cdelete_button { float:right; margin-right:10px; width:20px; height:20px } .feed_link { font-style:inherit; font-family:Georgia; font-size:13px;padding:10px; float:left; width:350px } .comment { color:#0000CC; text-decoration:underline } .delete_update { font-weight:bold; } .cdelete_update { font-weight:bold; } .post_box { height:55px;border-bottom:1px dashed #006699;background-color:#F3F3F3; width:499px;padding:.7em 0 .6em 0;line-height:1.1em; } #fullbox { margin-top:6px;margin-bottom:6px; display:none; } .comment_box { display:none;margin-left:90px; padding:10px; background-color:#d3e7f5; width:300px; height:50px; } .comment_load { margin-left:90px; padding:10px; background-color:#d3e7f5; width:300px; height:30px; font-size:12px; border-bottom:solid 1px #FFFFFF; } .text_area { width:290px; font-size:12px; height:30px; } #expand_box { margin-left:90px; margin-top:5px; margin-bottom:5px; } embed { width:200px; height:150px; } *{ margin:0px; padding:0px } ol.timeline { list-style:none } ol.timeline li { position:relative; border-bottom:1px #dedede dashed; padding:8px; } .morebox { font-weight:bold; color:#333333; text-align:center; border:solid 1px #333333; padding:8px; margin-top:8px; margin-bottom:8px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } .morebox a{ color:#333333; text-decoration:none} .morebox a:hover{ color:#333333; text-decoration:none} #container{margin-left:60px; width:580px } </style> </head> <body> <?php include '../../../settings.php'; ?> <div align="center"> <table cellpadding="0" cellspacing="0" width="500px"> <tr> <td> <div align="left"> <form method="post" name="form" action=""> <table cellpadding="0" cellspacing="0" width="500px"> <tr><td align="left"><div align="left"> <h3>What are you doing?</h3></div></td></tr> <tr> <td style="padding:4px; padding-left:10px;" class="update_box"> <textarea cols="30" rows="2" style="width:480px;font-size:14px; font-weight:bold" name="content" id="content" maxlength="145" ></textarea><br /> <input type="submit" value="Update" id="v" name="submit" class="comment_button"/> </td> </tr> </table> </form> </div> <div style="height:7px"></div> <div id="flash" align="left" ></div> <ol id="update" class="timeline"> </ol> <ol class="timeline" id="updates"> <div id='old_updates'> <?php $small=mysql_query("select * from messages2 order by msg_id desc LIMIT 5"); while($r=mysql_fetch_array($small)) { $id=$r['msg_id']; $msg=$r['message']; ?> <div align="left" class="post_box"> <span style="padding:10px"><?php echo $msg.'....'.$id; ?> </span> </div> <?php //Here $id is main message msg_id value. $csql=mysql_query("select * from comments where msg_id_fk='$id' order by com_id "); $array = mysql_fetch_assoc($csql); $comment_count=mysql_num_rows($csql); if($comment_count>2) { $second_count=$comment_count-2; ?> <div class="comment_ui" id="view<?php echo $id; ?>"> <a href="#" class="view_comments" id="<?php echo $id; ?>">View all <?php echo $comment_count; ?> comments</a> </div> <?php } ?> <div id="view_comments<?php echo $id; ?>"></div> <div id="two_comments<?php echo $id; ?>"> <table width="80%"> <?php $small2=mysql_query("select * from comments where msg_id_fk='$id' order by com_id limit 2 "); while($rowsmall22=mysql_fetch_array($small2)) { $c_id=$rowsmall22['com_id']; $comments=$rowsmall22['comment']; ?> <div class="comment_actual_text"> <tr> <td style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" valign="top"> <table style="WIDTH: 100%; BORDER-COLLAPSE: collapse" align="left"> <tr> <td width="5%" style="VERTICAL-ALIGN: middle; TEXT-ALIGN: center"><img style="WIDTH: 30px; HEIGHT: 30px" alt="srinivas" src="http://www.gravatar.com/avatar.php?gravatar_id=7a9e87053519e0e7a21bb69d1deb6dfe" border="1" /></td> <td style="VERTICAL-ALIGN: top; TEXT-ALIGN: left"> <strong>Jarratt</strong> <?php echo $comments; ?> <br /><span style="COLOR: #a9a9a9">10 min ago - ID = <?php echo $c_id.'...'.$id;?> </span></td> </tr> </table><br /> </td> </tr> </div> <?php } ?> </table> </div> <?php } ?> </ol> <div id="more<?php echo $id; ?>" class="morebox"> <a href="#" class="more" style='display:block;width:100%;' id="<?php echo $id; ?>">more <?php echo $id; ?></a> </div> </div> </td> </tr> </table> </div> </body> </html> if it help here is ajax_more.php PHP Code: <?php include("../../../settings.php"); if(isSet($_POST['lastmsg'])) { $lastmsg=$_POST['lastmsg']; $lastmsg=mysql_real_escape_string($lastmsg); $small=mysql_query("select * from messages2 WHERE msg_id<'$lastmsg' order by msg_id desc LIMIT 2"); while($r=mysql_fetch_array($small)) { $id=$r['msg_id']; $msg=$r['message']; ?> <div align="left" class="post_box"> <span style="padding:10px"><?php echo $msg.'....'.$id; ?> </span> </div> <?php //Here $id is main message msg_id value. $csql=mysql_query("select * from comments where msg_id_fk='$id' order by com_id "); $array = mysql_fetch_assoc($csql); $comment_count=mysql_num_rows($csql); if($comment_count>2) { $second_count=$comment_count-2; ?> <div class="comment_ui" id="view<?php echo $id; ?>"> <a href="#" class="view_comments" id="<?php echo $id; ?>">View all <?php echo $comment_count; ?> comments</a> </div> <?php } ?> <div class="comments" id="view_comments<?php echo $id; ?>"></div> <div id="two_comments<?php echo $id; ?>"> <table width="50%"> <?php $small2=mysql_query("select * from comments where msg_id_fk='$id' order by com_id limit 2 "); while($rowsmall22=mysql_fetch_array($small2)) { $c_id=$rowsmall22['com_id']; $comments=$rowsmall22['comment']; ?> <div class="comment_actual_text"> <tr> <td style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" valign="top"> <table style="WIDTH: 100%; BORDER-COLLAPSE: collapse" align="left"> <tr> <td width="5%" style="VERTICAL-ALIGN: middle; TEXT-ALIGN: center"><img style="WIDTH: 30px; HEIGHT: 30px" alt="srinivas" src="http://www.gravatar.com/avatar.php?gravatar_id=7a9e87053519e0e7a21bb69d1deb6dfe" border="1" /></td> <td style="VERTICAL-ALIGN: top; TEXT-ALIGN: left"> <strong>Jarratt</strong> <?php echo $comments; ?> <br /><span style="COLOR: #a9a9a9">10 min ago - ID = <?php echo $c_id.'...'.$id;?> </span></td> </tr> </table><br /> </td> </tr> </div> <?php } ?> </table> </div> <?php } ?> <div id="more<?php echo $id; ?>" class="morebox"> <a href="#" class="more" style='display:block;width:100%;' id="<?php echo $id; ?>">more <?php echo $id; ?></a> </div> <?php } ?> Similar Tutorialshi, the yahoo function below is for dragging a box around teh screen Code: (function() { var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event, dd1, dd2, dd3; YAHOO.example.DDRegion = function(id, sGroup, config) { this.cont = config.cont; YAHOO.example.DDRegion.superclass.constructor.apply(this, arguments); }; YAHOO.extend(YAHOO.example.DDRegion, YAHOO.util.DD, { cont: null, init: function() { //Call the parent's init method YAHOO.example.DDRegion.superclass.init.apply(this, arguments); this.initConstraints(); Event.on(window, 'resize', function() { this.initConstraints(); }, this, true); }, initConstraints: function() { //Get the top, right, bottom and left positions var region = Dom.getRegion(this.cont); //Get the element we are working on var el = this.getEl(); //Get the xy position of it var xy = Dom.getXY(el); //Get the width and height var width = parseInt(Dom.getStyle(el, 'width'), 10); var height = parseInt(Dom.getStyle(el, 'height'), 10); //Set left to x minus left var left = xy[0] - region.left; //Set right to right minus x minus width var right = region.right - xy[0] - width; //Set top to y minus top var top = xy[1] - region.top; //Set bottom to bottom minus y minus height var bottom = region.bottom - xy[1] - height; //Set the constraints based on the above calculations this.setXConstraint(left, right); this.setYConstraint(top, bottom); } }); I would like to show the final TOP and LEFT results in textboxes onMouseUP?! thanks in advance! I have a small form that I'm working on for a client. They want a form that their potential leads can fill out and then hit 'calculate rate'. Once this is done, the results should display on another page with a short summary of what their quote will be as well as some of the other information they filled out. It should also send an email to my client displaying the information that their lead just filled out. My only problem is I am not sure how to go about the calculation part. I know I would have to do an onSubmit, but how would I hide that calculation and then receive that number on another page. Here is the javascript for that form: Code: /* This source is shared under the terms of LGPL 3 www.gnu.org/licenses/lgpl.html You are free to use the code in Commercial or non-commercial projects */ //Set up an associative array //The keys represent the size of the cake //The values represent the cost of the cake i.e A 10" cake cost's $35 var practice_field = new Array(); practice_field["None"]=0; practice_field["Allergy and Immunology"]=4400; practice_field["Endocrinology"]=4400; practice_field["Pathology"]=4400; practice_field["Dermatology"]=4400; practice_field["Geriatrics"]=4400; practice_field["Physical Rehabilitation"]=4400; practice_field["Family Practice"]=6900; practice_field["General Practice"]=6900; practice_field["Internal Medicine"]=6900; practice_field["Oncology"]=6900; practice_field["Oral Surgery"]=6900; practice_field["Radiology"]=6900; practice_field["Gastroenterology"]=6900; practice_field["Infectious Disease"]=6900; practice_field["Nephrology"]=6900; practice_field["Ophthalmology"]=6900; practice_field["Pediatrics"]=6900; practice_field["Urology"]=6900; practice_field["Anesthesiology"]=9000; practice_field["Cosmetic Surgery"]=9000; practice_field["General Surgery"]=9000; practice_field["Neurology"]=9000; practice_field["Otolaryngology"]=9000; practice_field["Plastic Surgery"]=9000; practice_field["Vascular Surgery"]=9000; practice_field["Cardiology"]=9000; practice_field["Emergency Medicine"]=9000; practice_field["Gynecology"]=9000; practice_field["Orthopedic Surgery"]=9000; practice_field["Pain Management"]=9000; practice_field["Pulmonary Surgery"]=9000; practice_field["Neurological Surgery"]=9900; practice_field["Obstetrics"]=9900; //Set up an associative array //The keys represent the filling type //The value represents the cost of the filling i.e. Lemon filling is $5,Dobash filling is $9 //We use this this array when the user selects a filling from the form var society_member= new Array(); society_member["None"]=null; society_member["BCMA"]=0.10; society_member["DCMA"]=0.10; society_member["FOGS"]=0.10; society_member["FNS"]=0.10; society_member["PBCMS"]=0.10; society_member["FSPS"]=0.10; //This function finds the filling price based on the //drop down selection function getPracticeField() { var docPracticeField=0; //Get a reference to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the select id="filling" var selectedPracticeField = theForm.elements["practice"]; //set cakeFilling Price equal to value user chose //For example filling_prices["Lemon".value] would be equal to 5 docPracticeField = practice_field[selectedPracticeField.value]; //finally we return cakeFillingPrice return docPracticeField; } //This function finds the filling price based on the //drop down selection function getSelectedSociety() { var docSelectedSociety=0; //Get a reference to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the select id="filling" var selectedSociety = theForm.elements["society"]; //set cakeFilling Price equal to value user chose //For example filling_prices["Lemon".value] would be equal to 5 docSelectedSociety = society_member[selectedSociety.value]; //finally we return cakeFillingPrice return docSelectedSociety; } //candlesPrice() finds the candles price based on a check box selection function candlesPrice() { var candlePrice=0; //Get a reference to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the checkbox id="includecandles" var includeCandles = theForm.elements["includecandles"]; //If they checked the box set candlePrice to 5 if(includeCandles.checked==true) { candlePrice=0; } //finally we return the candlePrice return candlePrice; } function insciptionPrice() { //This local variable will be used to decide whether or not to charge for the inscription //If the user checked the box this value will be 20 //otherwise it will remain at 0 var inscriptionPrice=0; //Get a refernce to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the checkbox id="includeinscription" var includeInscription = theForm.elements["includeinscription"]; //If they checked the box set inscriptionPrice to 20 if(includeInscription.checked==true){ inscriptionPrice=0; } //finally we return the inscriptionPrice return inscriptionPrice; } function calculateTotal() { //Here we get the total price by calling our function //Each function returns a number so by calling them we add the values they return together var cakePrice = getPracticeField() + null - (getPracticeField() * getSelectedSociety()) + candlesPrice() + insciptionPrice(); //display the result var divobj = document.getElementById('totalPrice'); divobj.style.display='block'; divobj.innerHTML = "Your Pre-Paid Legal Defense Fee Will Be Around $"+cakePrice; } function hideTotal() { var divobj = document.getElementById('totalPrice'); divobj.style.display='none'; } If you look at the bottom you can see where the Function that Calculates everything is. Right now it calculates onClick. I just want it to calculate after the user has filled out the form completely and display that calculation on another page along with the rest of the information they inputted. Hi! I have been working on an assignment, and I seem to have things working okay, except that I'd like for the results (Message + list of 3 favorite movies or books) to show up in the Results box of the original page, not in a separate page. I'm sure it's something totally obvious that I'm missing, but I'm a newbie, and would appreciate any hints or tips that you all could give me. Thanks so much in advance! Heather W Hello I was looking for a javascript code to show an image in full size on moueover, I use this script on the site Code: function ShowPicture(id,Source) { if (Source=="1"){ if (document.layers) document.layers[''+id+''].visibility = "show" else if (document.all) document.all[''+id+''].style.visibility = "visible" else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible" } else if (Source=="0"){ if (document.layers) document.layers[''+id+''].visibility = "hide" else if (document.all) document.all[''+id+''].style.visibility = "hidden" else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden" } } CSS code i use: Code: <style type="text/css"> #Style { position:absolute; visibility:hidden; border:solid 1px #CCC; padding:5px; } </style> On the site to to body I put this html code: Code: <a href="#" onMouseOver="ShowPicture('Style',1)" onMouseOut="ShowPicture('Style',0)">Click Here To Show Image</a> <div id="Style"><img src="/sites/default/files/peroulades.jpg"></div> When Im hovering over the link image is shown full size, Problem: if you take a look: http://www.online-dovolenka.sk/dovolenka_korfu if hover over both links "Click Here To Show Image" you will see same image, but I put two different images? where is the problem? any ideas? Code: <a href="#" onMouseOver="ShowPicture('Style',1)" onMouseOut="ShowPicture('Style',0)">Click Here To Show Image</a> <div id="Style"><img src="/sites/default/files/peroulades.jpg"></div> <a href="#" onMouseOver="ShowPicture('Style',1)" onMouseOut="ShowPicture('Style',0)">Click Here To Show Image</a> <div id="Style"><img src="/sites/default/files/pantokrator.jpg"></div> There is a stand-alone, full-screen slide show code published at http://www.javascriptkit.com/script/...ow/index.shtml I would like to know how to set the size of the show to less than full-screen, and how to integrate the show with other web content. Dear Experts, I am very new for javascript so I am not even sure it is possible or not. The situation is like this, I have a page, which is actually a photo gallery with a table having 3 rows. First row shows the full screen size pic. Second row displays the Caption of that image and third row shows thumbnail view of six different images and the previous and next button. this is the sample layout: <table> <tr> <td colspan=8> Full size image will be shown in this cell </td> </tr> <tr> <td colspan=8> Caption of the image will be displayed here </td> </tr> <tr> <td>Previous Button</td> <td>Pic1 thumbnail view</td><td>Pic2 thumbnail view</td><td>Pic3 thumbnail view</td> <td>Pic4 thumbnail view</td><td>Pic5 thumbnail view</td><td>Pic6 thumbnail view</td> <td>Next Button</td> </td> </tr> My requirement is whenever the user click on the thumbnail view, which is in the 3rd row, the corresponding full screen size pic should open in 1st row of the table. As my photo gallery should be having more than 6 pics, lets take 20 pics, I want to show only 6 thumbnails in 3rd row at a time. Whenever user press "Next" button the 3rd row having 6 thumbnails should show other 6 thumbnails and previous button should show previous 6 thumbnails. I have a guess that it can be done using arrays, but how????? I have no idea. So please if you have any guesses it will be nice if you can post the entire code here as I will not be in a position to work on the hints given by you. Thanks in advance. Charles All, If I have the following code: Code: var http_request = false; function makePOSTRequest(url, parameters, str) { http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { // set type accordingly to anticipated content type //http_request.overrideMimeType('text/xml'); http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; } http_request.onreadystatechange = alertContents; http_request.open('POST', url, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); http_request.send(parameters); } function alertContents() { if (http_request.readyState == 4) { if (http_request.status == 200) { //alert(http_request.responseText); result = http_request.responseText; document.getElementById('myspan').innerHTML = result; window.location.hash = "#picture_id"; resizeAll(); } else { alert('There was a problem with the request.'); } } } function getpic(obj) { var poststr = "picture=" + encodeURI( document.getElementById("picture").value ); makePOSTRequest('getnextpic.php', poststr); } How can I parse: Code: result = http_request.responseText; So I can get a picture_id so I can update my hash on this line? Code: window.location.hash = "#picture_id"; Thanks in advance. disregard...i got it
Hi everyone, I only know basic programing and was hoping someone can give me a hand with implementing checkboxes. What I'm hoping to achieve is a form that will have a number of checkboxes that, when a box is checked, the text corresponding to said box will be logged at the bottom of the page. Each checkbox will also have a numerical value which will display the tally at the bottom. for example, I might have the following two boxes Box 1: I have a Bike +3 box 2: I have a Car +5 When both boxes are checked, the log at the bottom would read: I have a Bike +3 I have a Car +5 Total = +8 Code: <form action=""> <input type="checkbox" name="vehicle" value="Bike" /> I have a bike +3<br /> <input type="checkbox" name="vehicle" value="Car" /> I have a car +5 </form> OK I am wanting to build a table that I can enter data in to and have people sort by a drop down box like the 4th table down on this list -- http://www.javascriptkit.com/script/...lefilter.shtml But I have followed those instructions step by step and it never works. I was told to use .asp I have changed my page to a .asp and now have no clue where to go from here. In searching this site I have found this code -- [CODE] <script> function Filter(table){ var f=document.getElementById('f').value.toUpperCase(); for (a=1; a<table.rows.length; a++) { if (table.rows[a].cells[0].innerHTML.toUpperCase().indexOf(f)!=0) table.rows[a].style.display="none"; else table.rows[a].style.display="table-row"; } } </script> <table id="states" border=1> <tr><td>State</td><td>Code</td></tr> <tr><td>ALABAMA</td><td>AL</td></tr> <tr><td>ALASKA</td><td>AK</td></tr> <tr><td>MAINE</td><td>ME</td></tr> <tr><td>MARSHALL ISLANDS</td><td>MH</td></tr> </table> <form> <input type="text" name="f" id="f"> <input type="button" value="Filter" onclick="Filter(document.getElementById('states'));"> </form> [CODE] But it gives me a filter that I have to type in. I am looking for drop downs that allow me to filter so say you select drop down for fields that contain "A" then another drop down for a field that contains "B" so the results show fields that contain "A" and "B" And PS I am semi new to the code world so please don't assume I know some stuff dumb it down a little HAHA Hi guys im trying use a live search on my website, and iv found a code on the following link: http://www.w3schools.com/php/php_ajax_rss_reader.asp i understand it all but need to tweak it to suit my needs. What i need for it to do is search multiple drop down requests, for example: 1. first name 2. last name I want it to search by what has been selected (it is not necesary that all fields need to be selected, default will be any), however in the html it states: xmlhttp.open("GET","getrss.php?q="+str,true); and it only shows 1 option, i would like it to show multiple records. and once the records are shown, I would like the option of amending the search result any time in the search. please help Fixed.
I've implemented the Google CSE on my website and it works fine but I'd like to ask if there is a way to highlight the searched words on destination sites using javascript? i.e.: 1. I type into the search form the word I need to find on my website --> 2. I get result site with links to subsites --> 3. After clicking one of the listed links I go back to my website, to certain subsite --> 4. The word I've been searching for is highlighted so I can easily find it. Thanks in advance. I don't know if JavaScript is the best choice for this or maybe just Java but i want to create something were I can compare a list of names and their picks with a correct list. For example lets say this is the list of peoples picks... Code: Dan Slota New York Jets Dan Slota Cincinnati Bengals Dan Slota Pittsburgh Steelers Dan Slota Denver Broncos Dan Slota Green Bay Packers Dan Slota Atlanta Falcons Dan Slota New Orleans Saints Dan Slota Seattle Seahawks Dan Slota Indianapolis Colts Dan Slota Houston Texans Dan Slota Philadelphia Eagles Dan Slota San Diego Chargers Dan Slota Chicago Bears Dan Slota New England Patriots Danielle rossi New York Jets Danielle rossi Cincinnati Bengals Danielle rossi Baltimore Ravens Danielle rossi Tennessee Titans Danielle rossi Green Bay Packers Danielle rossi Atlanta Falcons Danielle rossi New Orleans Saints Danielle rossi St. Louis Rams Danielle rossi Indianapolis Colts Danielle rossi Houston Texans Danielle rossi Philadelphia Eagles Danielle rossi San Diego Chargers Danielle rossi Chicago Bears Danielle rossi Miami Dolphins David Fleischer New York Jets David Fleischer Cincinnati Bengals David Fleischer Baltimore Ravens David Fleischer Denver Broncos David Fleischer Green Bay Packers David Fleischer Atlanta Falcons David Fleischer New Orleans Saints David Fleischer Seattle Seahawks David Fleischer Indianapolis Colts David Fleischer Oakland Raiders David Fleischer Philadelphia Eagles David Fleischer San Diego Chargers David Fleischer New York Giants David Fleischer Miami Dolphins and here is the master list of the correct picks ... Code: Master List New York Jets Master List Cleveland Browns Master List Baltimore Ravens Master List Tennessee Titans Master List Green Bay Packers Master List Atlanta Falcons Master List New Orleans Saints Master List Seattle Seahawks Master List Indianapolis Colts Master List Houston Texans Master List Philadelphia Eagles Master List San Diego Chargers Master List New York Giants Master List Miami Dolphins After the user list is compared to the master list i need it to say the results of each user for example Code: David Fleischer 8 correct Danielle Rossi 9 correct Dan Slota 5 correct . . Sam Adams 2 correct [/CODE] What would be a good way of doing this? Any help would be appreciated Thanks. Hi I'm putting together the following website, HGV/LGV Training and have an issue regarding a form submit action. Basically I've used an open-source script for the search form so can't get any support from the Author. My problem is that I need the search results to appear in a different URL but at the moment they just appear in a new DIV on the home page. My knowledge of JS is limited and can't get my head around what the OS script is doing. I think the relevant section of the search form is as follows: <form method=post action=<?echo $_PHP_SELF;?>> <input type="text" name="zipcode"> <? echo show_country_codes(); ?> Any help on this would be greatly appreciated. Keith. We are integrating a IDX feed and I can not figure out a line of code. CMS: Joomla site: http://www.craigteamreno.com Top right hand corner "Quick Search" http://www.craigteamreno.com/quicksearch.js Currently when you click the link it goes to their site with the result we want. We want it to go to our site, just like "search homes," does. I believe it is simple but my HTML is even simpler. The link should just point to a wrap page.... but I dont know how to do that. THANKS! Hello, I'm new here and have gone through your forums looking for a fix for this but so far have not found one. Background: I am building an intranet site for my company and do not have access to server-side as of yet. Or else I would just use a different route to accomplish my issue. Issue: I am using an external app to index and build my search engine code(Search Engine Builder Pro v2.90). This works perfect if I wrap the code in a <div> or <table> but will not show inside of an iframe. HTML: Code: <div id="search"> <!-- ************************ BEGIN of search box code ************************ --> <FORM name="formSear" action="iframetest.html" method="GET" onSubmit="return qs();" rel="nofollow" target="ifr"> <script>function qs(){var f=document.formSear;var qe=f.searWords.value;if(window.encodeURIComponent)qe=encodeURIComponent(qe);if(f.area)if(f.area.value==2){document.location="http://www.google.com/search?q="+qe;return false;}var pt=document.location.href;var iq=pt.indexOf('?');if(iq!=-1)pt=pt.substring(0, iq);if(f.action)if(f.action!="")pt=f.action;var ue=pt+"?searWords="+qe;if(f.search)ue+="&search="+f.search.value;if(f.match)ue+="&match="+f.match.value;document.location=ue;return false;}</script> <p align="right"> <INPUT name="searWords"> <INPUT name="Send" type="submit" value="Search"> <p align="left"> </FORM> <!-- ************************ END of search box code ************************** --> </div> Code: <IFRAME name="ifr" width="100%" height="90%" frameBorder=0 marginHeight=0 marginWidth=0 scrolling="auto" src=""> <script type="text/javascript" language="JavaScript" src="webdata.js"> </script> <script type="text/javascript" language="JavaScript" src="searchfunc.js"> </script> </IFRAME> searchfunc.js: Code: //Translate search result info into your language StrYourSearch="Your search"; //Your search StrNewSearch="New Search"; //New Search StrCloseWindow="Close Window"; //Close Window StrFind="Found"; //Find StrItems="item(s)"; //items strResultPage="Result Page"; //Result Page strPrevious="Previous"; //Previous strNext="Next"; //Next //Options for the search engine MatchingStrategy=0; //0:Use all words,1:Use any words,2:Use exact phrase SearchStrategy=0; //0:search all text,1:Search title,2:Search keywords,3:Search description,4:Search File name ItemsPerPage=10; //Display how many items of search result on per page MatchCaseSensitive=0; //0:Not case sensitive,1:case sensitive ResultLinkTarget=""; //default value: "", can be "_self", "_top", "_blank", "_parent" or name you defined OutPutWindowType=3; //0:same window,1:new window,2:use frame,3:use iframe OutPutNewWindowProperty="resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=no,directories=no,width=590,height=300"; OutPutNewWindowOpenMode=0; //0:Always open new window,1:Reuse the window opened SearchFormFrame="search"; //The search box frame name OutputTarget="_top"; //default value: "result", can be "_self", "_top", "_parent" or name you defined ChangeLinkCaseProp=0; //0:Unchanged,1:to lower case,2:to upper case NumberSearchResult=1; //0:Not display,1:Display number OutputMaxCharsPerResultText=200; //how many characters of search result text will be output, default value: 200 OutPutResultTitle=1; //0: not output,1: output OutPutResultText=1; //0: not output,1: output OutPutResultUrl=1; //0: not output,1: output OutPutResultInfo=1; //0: not output,1: output OutputFileSize=1; //0: not output,1: output OutputFileDate=1; //0: not output,1: output NoHorizLine=0; //0: has Horizontal lines,1: no NoPoweredBy=1; //0: has Powered By info,1: no arrResultTitleFont=new Array("",0,'3','Arial',0,'#0000ff',1); arrResultTextFont=new Array("",0,'2','Arial',0,'#000000',0); arrResultUrlFont=new Array("",0,'2','Arial',0,'#008000',0); arrResultInfoFont=new Array("",0,'2','Arial',0,'#000000',0); arrHitTitleFont=new Array("",0,'3','Arial',0,'#cc0033',1); arrHitTextFont=new Array("",0,'2','Arial',0,'#cc0033',0); DecorateBefore=""; //Decorate HTML code before search results DecorateAfter=""; //Decorate HTML code after search results AddLinksParameters=""; //Add parameters to the search result link ExcludedSearchWords=new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0","!","*","(",")","-","_","+","=","\\","{","}","[","]",":",";","\"","'","<",">",",",".","?","/","about","above","after","again","all","also","am","an","and","any","are","as","at","back","be","been","before","behind","being","below","but","by","can","click","do","does","done","each","else","etc","ever","every","few","for","from","generally","get","go","gone","has","have","hello","here","how","if","in","into","is","it","just","keep","later","let","like","lot","lots","made","make","makes","many","may","me","more","most","much","must","my","need","no","not","now","of","often","on","only","or","other","others","our","out","over","please","put","so","some","such","than","that","the","their","them","then","there","these","they","this","try","to","up","us","very","want","was","we","well","what","when","where","which","why","will","with","within","you","your","yourself","&"); RootReplaceURL=""; SEBWebsite="http://www.aleadsoft.com";SEBEmail="support@aleadsoft.com";SEBAuthor="ALeadSoft.com, Inc.";CurScriptType="JS";bNoSpace=0;eval(unescape("Copyright%3D%22ALeadSoft__Search_Engine_Builder%22%3BstrCode%3D%22%23%3E%23%3D%7C%25@%23+*%5E-%23%3D%7C%25%23%3D%7C%25@%23+*%5E-%23%3D%7C%25@%23+*%23%3D%7C%25@%23+*@%23+*%23%3D%7C%25@%23+*%3D%7C%25@%23+*%5E%3Ca%20href%3D%27%22%3Bvar%20s0%3D%22%22%3B%20var%20s1%3Dnew%20Array... Anything after this is just way too long to link as code here. So much that it locks my browser up if I try to highlight it all. Yes I know the .js is very unorganised but thats the format that Search Engine Builder outputs it. So I have added a rel="nofollow" target= to the <form> and tried to link it that way. I have tried dynamically calling an iframe through Jscript. If I could get all my pages to stay in another tyope of container when a link is clicked I would just use it instead. At this point I'm just looking for any ideas to fix my issue. Thank you in advance. Jalowery Edit: I was also thinking of pulling the results.html page into the iframe which is much easier. But then I can't figure out how to get the search results to be sent to the results.html page. Right now I am trying to grab all the links on a html page a store them in an array so that they can be accessed by a loop that makes sure that each one works. Right now I am not getting very far with it. If someone could help me I would be greatly appreciative.
All, I have the following code: console.log("My num is: " + num); console.log("My lat is: " + lat); console.log("My lat length is: " + lat.length); console.log("My long is: " + long); When I get the output, I get the following: My num is: {"1":1,"2":2} My lat is: {"1":"40.59479899","2":"41.4599860"} My lat length is: 36 My long is: {"1":"-75.5549650","2":"-87.596430"} I'm confused on why the length is saying 36 when it's obviously two and the other output shows that??? |