JQuery Autocomplete issue - JavaScript Help


not sure if this is the correct forum to post this in but here goes...

Im using the JQuery Autocomplete function on a field. The select field pulls data from a recordset and works perfectly. The autocomplete works fine if you type into the field but if you click the button to drop down the list to select an option for some reason it tries to submit the form that the field is sitting in.

Here is the code I am using. It is the standard code, all I have changed is the field it links to:

(function($) { $.widget("ui.combobox", { _create: function() { var self = this; var select = this.element.hide(); var input = $("") .insertAfter(select) .autocomplete({ source: function(request, response) { var matcher = new RegExp(request.term, "i"); response(select.children("option").map(function() { var text = $(this).text(); if (!request.term || matcher.test(text)) return { id: $(this).val(), label: text.replace(new RegExp("(![^&;]+;)(!)(![^&;]+;)", "gi"), "$1"), value: text }; })); }, delay: 0, select: function(e, ui) { if (!ui.item) { // remove invalid value, as it didn't match anything $(this).val(""); return false; } $(this).focus(); select.val(ui.item.id); self._trigger("selected", null, { item: select.find("[value='" + ui.item.id + "']") }); }, minLength: 0 }) .addClass("ui-widget ui-widget-content ui-corner-left"); $(" ") .insertAfter(input) .button({ icons: { primary: "ui-icon-triangle-1-s" }, text: false }).removeClass("ui-corner-all") .addClass("ui-corner-right ui-button-icon") .position({ my: "left center", at: "right center", of: input, offset: "-1 0" }).css("top", "") .click(function() { // close if already visible if (input.autocomplete("widget").is(":visible")) { input.autocomplete("close"); return; } // pass empty string as value to search for, displaying all results input.autocomplete("search", ""); input.focus(); }); } }); })(jQuery); $(function() { $("#ToUserID").combobox(); }); /* TODO shouldn't be necessary */ .ui-button-icon-only .ui-button-text { padding: 0.35em; } .ui-autocomplete-input { padding: 0.48em 0 0.47em 0.45em; }
Here is the form on the page (I'm using a Dreamweaver Developer Toolbox function for this form):

To: 0) { mysql_data_seek($Users, 0); $row_Users = mysql_fetch_assoc($Users); } > Subject: displayFieldHint("MessageTitle");> displayFieldError("messaging", "MessageTitle"); > Body: displayFieldHint("MessageContent");> displayFieldError("messaging", "MessageContent"); >
Posted On: Wednesday 2nd of January 2013 12:42:22 AM Total Views:  257
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




remove a list item

I would like to know how can i remove a selected item from an ordered list which was dynamicaly created\t Thanking you in advance!!
VIEWS ON THIS POST

194

Posted on:

Thursday 22nd November 2012
View Replies!

submit button working fine in i.e but giving error?

Thanks a lot Graphix
VIEWS ON THIS POST

161

Posted on:

Saturday 24th November 2012
View Replies!

Any advice on how to build a simple javascript form?

Any help would be appreciated
VIEWS ON THIS POST

179

Posted on:

Saturday 24th November 2012
View Replies!

jquery ajax not working

ok so i am using jquery ajax to send post data to the php page to get processed. since im using a textarea with an editor on it i have to call the content like so var content = $('#pagecontent').val(); then post it through to the php page. which works but it seems to have a problem with a an & symbol in the post data. it cuts off the rest of the code after an & symbol. when get the contents of the textarea with console.log($("#pagecontent").val()) it grabs all the content. Even the content after the & symbol. then i post it through and have php output the contents that is submitted and then i see that the rest of the content after the & is gone. So the problem that i am having is why is the ajax posting cutting off my content after an & symbol. it seems to grab the content fine before the submitting.
VIEWS ON THIS POST

146

Posted on:

Sunday 25th November 2012
View Replies!

Simple noob question.

I need to make this code set "str" as "Recent" if the "str" got no value. Right now i have to use this: Select album: Somealbumname but its really annoying to have to use the select, i want the code to load with the "str" as "Recent" if its not declared already. function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","xxxx/xxxx.phpq="+str,true); xmlhttp.send(); }
VIEWS ON THIS POST

167

Posted on:

Sunday 25th November 2012
View Replies!

Multiple File selection

I write a upload code in php no problem in php but i want to select a multiple files(images) in single form tag() is it possible then how help me
VIEWS ON THIS POST

66

Posted on:

Sunday 25th November 2012
View Replies!

The best free JavaScript IDE

I am starting to learn JavaScript. But now I need a good IDE to code. Obviously I need a free IDE, I am not planning to make money with my code. Can experts give me some advice.
VIEWS ON THIS POST

88

Posted on:

Sunday 25th November 2012
View Replies!

How to show a field based on another fields value

Hi all, I am trying to show a field based on another field's value and hide it it initially... like when you want students to select their schools if they have gone for education ortherwise the school field remains inactive... I have the folowing scipt but it is not being fired on page load... I don't know where am going wrong.... function OnPageLoadAdd(pageid) { var tName = 'dbo.Register'; var ctrleducation = Runner.controls.ControlManager.getAt(tName, pageid, 'education'); var ctrlCollage = Runner.controls.ControlManager.getAt(tName, pageid, 'Collage'); ctrleducation.on('change', function(e){ if (this.getValue() == 'yes'){ ctrlCollage.setEnabled(); ctrlCollage.addValidation("IsRequired"); }else{ ctrlCollage.setDisabled(); ctrlCollage.setValue(""); ctrlCollage.removeValidation("IsRequired"); } }); }
VIEWS ON THIS POST

130

Posted on:

Sunday 25th November 2012
View Replies!

facebook login problem

app: http://apps.facebook.com/brainchecker this was just for learning experience I am having trouble with how to get the permissions dialog open directly instead of that initial go to facebook.com page which directs me to the dialog
VIEWS ON THIS POST

116

Posted on:

Sunday 25th November 2012
View Replies!

scriptData problem with Uploadify

am having a lot of headache trying to pass values to upload.php I have tried various ways to pass one parameter but it is always empty in upload.php. I have seen the sample but I failed to get it right nor all the other tutorials outthere helped me out. here is the code i am using $(document).ready(function() { $("#UploadImages").fileUpload({ 'uploader': '/mysite/fbox/uploader.swf', 'cancelImg': '/mysite/fbox/cancel.png', 'script': '/mysite/fbox/upload.php', 'folder': '1502', 'multi': true, 'buttonText': 'Add Photos', 'checkScript': '/mysite/fbox/check.php', 'displayData': 'percentage', 'scriptData': {'serah':1502}, 'fileExt': '*.jpg;*.jpeg;*.gif;*.png', 'simUploadLimit': 2, onError: function (a, b, c, d) { if (d.status == 404) alert('Could not find upload script. Use a path relative to: '+''); else if (d.type === "HTTP") alert('error '+d.type+": "+d.status); else if (d.type ==="File Size") alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB'); else alert('error '+d.type+": "+d.text); }, }); }); function startUpload(id){ $('#UploadImages').fileUploadSettings('scriptData',"serah="+id); //alert('&name='+$('#name3').val()+'&location='+$("#location").val()); $('#UploadImages').fileUploadStart(); } And in the body section, I am trying both: Photo Uploader Error Start Upload Start Upload | Clear Queue I am having to Start Upload commands because I want to try them both but both failed. By the way, even the following variable don't go to upload.php 'folder': '1502', and upload.php is
VIEWS ON THIS POST

87

Posted on:

Sunday 25th November 2012
View Replies!

javascript image check not working

Maybe the cam depends on http://ip.benellis.info being available. If so then the cam will go down in sympathy with the site. I don't know what the mechanism might be but maybe something to do with the way the stream/snapshots are uploaded
VIEWS ON THIS POST

116

Posted on:

Sunday 25th November 2012
View Replies!

get url help

i have a top frame with a webpage. i have a bottom frame with the javascript. I'm trying to get the url of the top frame with javascript. the top frame id is link_frame. i'm trying get an alert box with the top frames url. the code i tried isn't working. Get function Url() { var CurrentUrl = document.getElementById('link_frame').contentWindow. location.href; alert("CurrentUrl"); }
VIEWS ON THIS POST

204

Posted on:

Sunday 25th November 2012
View Replies!

Another Checkbox question!

Hi folks, I'm afraid I'm pretty new to javascript, so I apologize in advance for my inexperience. I am trying to do a simple thing: I have a page with three items that I want the user to agree to (a beta signup agreement). I want them to have to check off all three boxes before the "continue" button becomes active. I've searched and searched and found a few tutorials, but they only seem to get me halfway and then drop me off a cliff... I don't need this to be a submit form or anything, just click the three boxes and then you can hit the "continue" button. Thank you for your help!
VIEWS ON THIS POST

83

Posted on:

Sunday 25th November 2012
View Replies!

Button to send POST data

Button below opens new popup window but doesn't send POST data from form. How can i send POST data I know "form action" but, i want this way.
VIEWS ON THIS POST

76

Posted on:

Sunday 25th November 2012
View Replies!

Javascript newbie help!

quick question, I am a newbie, first with this site, and with programming. this is my first semester and I am learning the basics. I am having a problem with Javascript. this simple code is supposed to just create a web page with the tile , my name and then I am supposed to add text to the page (using astericks), according to the visitor input information. I have the code working to the point of asking which object (right trangle, left triangle, isoceles triangle or rectangle), I have it then alerting the question about the height of the object, (the while loop i have in there set to give an invalis response it working well, the problem I have it getting the actual text on the page in the shape of the object as astericks, anytime I use the document.write(), i get a number (from the user) that screams across the page and gives me a scriptting error. This is probably something simple, dont laugh too hard. O have tried several different ways and used the w3schools website for more info and cant seem to get this to work. any suggestions, maybe another website with more examples.
VIEWS ON THIS POST

151

Posted on:

Sunday 25th November 2012
View Replies!

checkWin array for Java Tic Tac Toe

This is due midnight tonight. I have most of it done but can't get the checkWin method to work correctly. I've worked on it for hours with almost no progress so any help would be great. Here is my checkWin method: public boolean checkWin(char mark) { boolean won = false; // Variable holding the return value boolean diagonal = true; for(int i=0; i draw result = GameResult.draw; break; } } } } GameBoard Class: // This class is responsible for representing the game board public class GenGameBoard { // Declare variables holding the marks for each position private int size; private char[][] board; // Constructor method - initializes each position variable public GenGameBoard(int n) { //Initializes the board size attribute size = n; board = new char [size][size]; for (int i =0; i
VIEWS ON THIS POST

169

Posted on:

Monday 26th November 2012
View Replies!

Method for navigating to a specific accordion page

So are all pages going to be the same, with just the accordian bit expanded for the topic, or is there extra dynamic content above the accordian If you are just using the accordian, you could use a jQuery click() event to change which accordian part is expanded. If you have different pages, then it depends on whether you are using a server-side programming language or not. If you are using a server-side programming language, I would suggest passing parameters via GET or POST. If you aren't using a server-side language, then you should be able to use the onready Javascript event to expaqnd the appropriate accordian.
VIEWS ON THIS POST

99

Posted on:

Monday 26th November 2012
View Replies!

form verification using regular expressions

I keep getting an error that says item is null. I'm a little lost because once I got my regExp to start working this actually worked for a little bit. When I came back i was getting an error. I have no idea what i did. var creditExp = /^([345])(\d{3})\-(\d{4})\-(\d{4})\-(\d{4})$/; var creditNumber = document.getElementById("creditnum").value; var item = creditExp.exec(creditNumber); document.getElementById("creditnum").value = item[1] + item[2] + "-" + item[3] + "-" + item[4] + "-" + item[5]; if (item[1] == 4 && document.getElementById("card1").checked == true) { return true; } else if (item[1] == 5 && document.getElementById("card2").checked == true) { return true; } else if (item[1] == 3 && document.getElementById("card3").checked == true) { return true; } else { alert("You must enter a valid credit card number."); document.getElementById("creditnum").focus(); return false; } var billingName = document.getElementById('creditname').value; if (billingName == null || billingName == "") { alert("You must enter your first name as printed on your credit card!"); document.getElementById('creditname').focus(); return false; }
VIEWS ON THIS POST

169

Posted on:

Monday 26th November 2012
View Replies!

Onsubmit condn to pass session variable doesnot work

hi, I m a student working on my dissertation. i m using scriptlet and javascript. I have two frames. In the first frame i have set session attributes which i get in the second frame. i have used onsubmit condn to pass the session attributes. but i get the value as null in the second frame. my first frame (slash.jsp) is: function sel(){ parent.frames['map'].location.href='javascript:in3();' } Male Female my second frame map.jsp is function in3(){ var x= document.getElementById('sex').value; alert(x); } i get the alert as null.
VIEWS ON THIS POST

112

Posted on:

Monday 26th November 2012
View Replies!

equal height classes

hi hi! I have encounter a problem that need to equal height in different classes. Currently I using this code from cssnewbie : function equalHeight(group) { var tallest = 0; group.each(function() { var thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(".contentA")); equalHeight($(".contentB")); }); The scenario is 3 columns boxes need to have an equal height. It has background and content. Left and middle boxes sharing the same class and ID, and the right box has different class and ID. It is 2 row and 3 column. Now the bottom left and middle are looking fine, but not the right column boxes. Is it possible to calculate the tallest height - the shortest height, then get the remaining height to add into the shortest height. So it is equal. Any code I can reference
VIEWS ON THIS POST

58

Posted on:

Monday 26th November 2012
View Replies!

Find all dropdownlist's id using jquery

I have a panel named "listState" on my aspx page Now in that panel i have number of dropdowns. I want id of that all dropdownlist present in "listState" How can i do this using JQUERY I tried following code $('#').find("select") But it doesnt gives me id of all dropdownlist. What to do to achieve this.
VIEWS ON THIS POST

78

Posted on:

Monday 26th November 2012
View Replies!

JSON WTF

Hi all the problem lies with the createJSON function for some reason it is breaking no idea why though. please advise... User Details function validateForm(){ var x=document.forms["myForm"]["username"].value if (x==null || x=="") { alert("username must be filled out"); return false; } var y=document.forms["myForm"]["email"].value if (y==null || y=="") { alert("email must be filled out"); return false; } var z=document.forms["myForm"]["firstname"].value if (z==null || z=="") { alert("firstname must be filled out"); return false; } var a=document.forms["myForm"]["surname"].value if (a==null || a=="") { alert("surname must be filled out"); return false; } var b=document.forms["myForm"]["birthday"].value if (b==null || b=="") { alert("birthday must be filled out"); return false; } var c=document.forms["myForm"]["password"].value if (c==null || c=="") { alert("password must be filled out"); return false; } var d=document.forms["myForm"]["pwdconfirm"].value if (d==null || d=="") { alert("pwdconfirm must be filled out"); return false; } var e=document.forms["myForm"]["gender"].value if (e=="nothing") { alert("gender must be chosen"); return false; } validateEmail(); } function validateEmail(){ var h=document.forms["myForm"]["email"].value var atpos=h.indexOf("@"); var dotpos=h.lastIndexOf("."); if (atpos
VIEWS ON THIS POST

69

Posted on:

Monday 26th November 2012
View Replies!

Sequential Numbers in Adobe Acrobat

I am trying to create an Acrobat form that a user fills out. Each form must have a unique number and once a form is used, the next number must be in sequence from the previous one. I think a dynamic stamp will work, but I don't know anything about the Java Script that goes with it. Does anyone know how to do this or where I start
VIEWS ON THIS POST

129

Posted on:

Monday 26th November 2012
View Replies!

slide show Problemo

all, Just took a JavaScript class, where they didn't teach us anything about slide shows. Now I have a client and I promised them a slide show on their website. I made an external Js file, and Firefox debugger keeps on giving me this error: document[place].src is undefined. Here's the code from the external .js, again really unfamiliar with this so I based it off example code I found: var num=0; var imgName="pictures/"; var slideImg= new Array(); slideImg[0]=new imageItem(imgName+"1.jpg"); slideImg[1]=new imageItem(imgName+"2.jpg"); slideImg[2]=new imageItem(imgName+"3.jpg"); function imageItem(image_location) { this.image_item = new Image(); this.image_item.src = image_location; } function get_ImageItemLocation(imageObj) { return(imageObj.image_item.src) } function getNextImage() { if(num < slideImg.length) { var new_img=get_ImageItemLocation(slideImg[num]); return(new_img); } else { num=1; } } function switchImage(place) { var new_img = getNextImage(); document[place].src=new_img; setTimeOut(switchImage(place)); } The problem should be in the last function switchImage().
VIEWS ON THIS POST

122

Posted on:

Monday 26th November 2012
View Replies!

Getting Index of a Form Element

I'm trying to determine a better method of finding the index value of a form element. I need to find it because the JavaScript validation class has a function for validating a single form element, but it requires that the index number of the element in the form be passed in. Currently I am accomplishing this by a function that I wrote which I call for each field I want to validate: function getIndex(element) { for (var i=0; i
VIEWS ON THIS POST

49

Posted on:

Monday 26th November 2012
View Replies!

Dowloading files from servers opens new window in?

In my project im using CGI and c++ in the server. When ever i download files from the server, IE 8 opens a window for every file downloaded. Then it does not close that damn new window. Please help me remove these extra windows.
VIEWS ON THIS POST

115

Posted on:

Monday 26th November 2012
View Replies!

Call dynamically created form items.

I want to be able to access whatever the user types into my testCreation.html in a session created in testCheck.php. I then want that session to be accessed by testView.php. I can't seem to get to that point so any help is grealy appreciated. testCreation.html: Untitled Page var questionNum = 1; function include(file) { if (document.createElement && document.getElementsByTagName) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', file); head.appendChild(script); } else { alert('Your browser can\'t deal with the DOM standard. That means it\'s old. Go fix it!'); } } function includes() { include("testCheck.php"); } function addQuestion() { var paragraph = document.createElement("p"); document.getElementById("divRadiolist").appendChild(paragraph); var newQuestion = document.createTextNode(questionNum + ". \n"); document.getElementById("divRadiolist").appendChild(newQuestion); document.getElementById("divRadiolist").appendChild(paragraph); var myText = document.createElement("input"); myText.id = "text" + questionNum; myText.setAttribute("type", "text"); myText.setAttribute("name", "question"+questionNum); myText.style.width = "1000px"; myText.style.height = "25px"; document.getElementById("divRadiolist").appendChild(myText); questionNum++; } testCheck.php: testView.php: - Kind
VIEWS ON THIS POST

131

Posted on:

Monday 26th November 2012
View Replies!

how to change id by adding new row..

I think i got the solution..!! we can change id even in CloneNode.>!! :) . .
VIEWS ON THIS POST

89

Posted on:

Monday 26th November 2012
View Replies!

drop down navigation errors

, Im having trouble getting a button to link to a banquet page, I know its probably somethign simple but i cant seem to figure it out DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> New Document /* Sample CSS definition for the example list. Remove if deed */ .dropmenudiv{ position:absolute; background-color:#99CDFF; border:1px solid #04255A; font:bold 16px timesnewroman; color:#04255A; line-height:25px; z-index:100; text-align:center; } .dropmenudiv a{ display: block; text-indent: 1px; border: 1px solid #04255A; padding: 0px 2; text-decoration: none; font-weight: bold; color:#04255A; text-align:center; } .dropmenudiv a:hover{ /*hover background color*/ background-color: #99CDFF; display: block; text-indent: 1px; border-bottom: 1px solid #04255A; padding: 0px 2; text-decoration: none; font-weight: bold; color:#04255A; } .navlist { font-family:verdana; font-weight:bold; font-size:12px; color: #a4a4a4; line-height:25px; text-decoration:none; } .navlist a:hover { font-family:Sans Serif; font-weight:bold; font-size:12px; color: #ff0000; line-height:25px; text-decoration:none; } .anylinkcss{ position:absolute; visibility: hidden; border:1px solid gray; border-bottom-width: 0; font:normal 11px Sans Serif; line-height: 18px; z-index: 100; background-color: white; width: 205px; } .anylinkcss a{ color: black; width: 100%; display: block; text-indent: 3px; border-bottom: 1px solid gray; padding: 1px 0; text-decoration: none; font-weight: bold; text-indent: 5px; } .anylinkcss a:hover{ /*hover background color*/ background-color: #F8FBBD; color: black; } var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) var enableanchorlink=0 //Enable or disable the anchor link when clicked on (1=e, 0=d) var hidemenu_onclick=1 //hide menu when user clicks within menu (1=yes, 0=no) var horizontaloffset=1 //horizontal offset of menu from default location. (0-5 is a good value) /////No further editting needed var ie5=document.all var ns6=document.getElementById&&!document.all function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left") what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left") totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function showhide(obj, e, visible, hidden){ if (ie5||ns6) dropmenuobj.style.left=dropmenuobj.style.top=-500 if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden } function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat") document.documentElement : document.body } function clearbrowseredge(obj, whichedge){ var edgeoffset=0 if (whichedge=="rightedge"){ var windowedge=ie5 && !window.opera iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+(horizontaloffset*2) //no space to the right of page Move menu over to the left } else{ var topedge=ie5 && !window.opera iecompattest().scrollTop : window.pageYOffset var windowedge=ie5 && !window.opera iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight if ((dropmenuobj.y-topedge)
VIEWS ON THIS POST

76

Posted on:

Tuesday 27th November 2012
View Replies!

need some help new to javascript

could someone take a look at this new to javascript
VIEWS ON THIS POST

101

Posted on:

Tuesday 27th November 2012
View Replies!

Javascript validation not working with form of multipart/form-data - JavaScript Help

Hi ,Been stuck for a few days with this scenario.Any helpThe alert box appears on an error.But the submitting won't stop.The details are submitted and the form is processed.Any help is greatly appreciated... tinyMCE.init({ // General options mode : "textareas", theme : "simple" }); function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); } function err_check(){ var email = document.getElementById('to_email').value; if(email.length==0){ alert('Please Enter Email Address'); return false; } var AtPos = email.indexOf("@") var StopPos = email.lastIndexOf(".") if (AtPos == -1 || StopPos == -1) { alert("Please Enter Valid Email Address"); document.getElementById('email').focus(); return false; } email = document.getElementById('cc_email').value; if(email.length != 0){ var AtPos = email.indexOf("@") var StopPos = email.lastIndexOf(".") if (AtPos == -1 || StopPos == -1) { alert("Please Enter Valid Email Address"); document.getElementById('email').focus(); return false; } } var answer = confirm ("Send E-Mail"); if (!answer){ return false; } } body, table, td, th{ background-color:#CCCCCC; font-family: Arial; font-size:14px; } .que{ font-weight:bold; }
VIEWS ON THIS POST

60

Posted on:

Tuesday 27th November 2012
View Replies!

performance on my js script - JavaScript Help

, So this is my problem. I basically have 2 scripts running. one controls a video (through quicktime plug in) and the second controls a menu. The script that controls the menu does animation. When the movie and the menu animation run at the same time, the menu animation moves to a crawl. no idea how to fix thisHere is my code var episodes = [ ['Redavenger and Friends', [ ['Episode 0', 27, 4, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 1', 27, 36, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 2', 27, 24, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 3', 27, 14, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 4', 27, 10, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 5', 27, 40, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 6', 27, 78, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 7', 27, 64, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'] ] ], ['Season 0', [ ['Episode 8', 27, 4, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 9', 27, 84, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 10', 27, 82, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 11', 27, 50, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 12', 27, 88, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 13', 27, 56, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 14', 27, 50, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'], ['Episode 15', 27, 68, 12, 'Hero1.jpg', 'lorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit ametlorem ipsum dolor sit amet lorem ipsum dolor sit amet'] ] ] ]; // functions function isArray(obj){ return Object.prototype.toString.apply(obj) === '[object Array]'; } // prototypes String.prototype.divs = function(insert){ if(typeof insert != 'undefined'){insert = " "+insert+" ";}else{insert = "";} return '' + this + ''; } String.prototype.img = function(src, insert){ if(typeof insert != 'undefined'){insert = " "+insert+" ";}else{insert = "";} if(typeof src != 'undefined') return ""; } Number.prototype.pad = function(){ if(this < 10){return '0' + this;} return this; } //MENU FILL menu = new Object(); menu.season = function(){ var finalMenu=""; var item=""; for(var z=0; z distance){theDiv.scrollLeft -= 1;} if(divStart < distance){theDiv.scrollLeft += 1;} }else{ divStart = theDiv.scrollTop; if(divStart > distance){theDiv.scrollTop -= 1;} if(divStart < distance){theDiv.scrollTop += 1;} } if(divStart == distance || scrolling.lastValue == divStart){ clearInterval(Timer); if(distanceStart == 0 && direction == 'x'){scrolling.fade('back');}else{scrolling.fade('back', 'true');} scrolling.process = false; scrolling.lastValue = null; }else{ scrolling.lastValue = divStart; } } distance *= menu.divSize(divId, direction); Timer = setInterval("animation()", speed); } scrolling.process = false; scrolling.fade = function(id, reverse){ var value = 0; start = function(id, value){ testObj = document.getElementById(id); testObj.style.opacity = value/100; testObj.style.filter = 'alpha(opacity=' + value*10 + ')'; if(value == 100){clearInterval(Timer2);} } if(reverse != 'true'){Timer2 = setInterval(function(){start(id, ++value)}, 15);}else{value=100;Timer2 = setInterval(function(){start(id, --value)}, 15);} } // video controller time = {hours: 0, mins: 0, secs: 0, state: 'notStarted'} time.set = function(){ ss = (document.qtmovie_embed.GetTime() / time.scale); time.percent = Math.round(100 * (ss / time.duration)); time.hours = Math.round((ss / 3600) - .5); time.mins = Math.round(((ss / 60) - .5)-(time.hours * 60)); time.secs = Math.round(ss-(Math.round((ss/60)-.5)*60)); } time.update = function(){ time.set(); newTime = time.hours.pad() + " : " + time.mins.pad() + " : " + time.secs.pad(); document.getElementById('pointer').style.width = Math.round(((time.percent/100) * time.inFrames)-.5) + "px"; document.getElementById('test').innerHTML = newTime; document.getElementById('test2').innerHTML = time.duration.pad(); } function loaded(){ time.duration = document.qtmovie_embed.GetDuration() / document.qtmovie_embed.GetTimeScale(); time.scale = document.qtmovie_embed.GetTimeScale(); time.inFrames = menu.divSize('progresscontainer', 'x'); var finalTimeLine = ""; for(var i = 1; i = 256){current = 217;} document.qtmovie_embed.SetVolume(current + 39); }else{ if((current - 39)= 217) {document.getElementById('vol-6').style.backgroundImage = 'url(images/vol_6.png)'}else{document.getElementById('vol-6').style.backgroundImage = 'url(images/emvol_6.png)';} if(current >= 178) {document.getElementById('vol-5').style.backgroundImage = 'url(images/vol_5.png)'}else{document.getElementById('vol-5').style.backgroundImage = 'url(images/emvol_5.png)';} if(current >= 139) {document.getElementById('vol-4').style.backgroundImage = 'url(images/vol_4.png)'}else{document.getElementById('vol-4').style.background = 'none'} if(current >= 100) {document.getElementById('vol-3').style.backgroundImage = 'url(images/vol_3.png)'}else{document.getElementById('vol-3').style.background = 'none'} if(current >= 61) {document.getElementById('vol-2').style.backgroundImage = 'url(images/vol_2.png)'}else{document.getElementById('vol-2').style.background = 'none'} if(current > 0) {document.getElementById('vol-1').style.backgroundImage = 'url(images/vol_1.png)'}else{document.getElementById('vol-1').style.background = 'none'} document.getElementById('test3').innerHTML = document.qtmovie_embed.GetVolume().pad(); } function myAddListener(obj, evt, handler, captures){ if(!captures){captures=false;} if ( document.addEventListener ) obj.addEventListener(evt, handler, captures); else obj.attachEvent('on' + evt, handler); // IE requires this form } function setup(){ // register for events on the element, our handler will be triggered even if // the browser uses the because events pass through the parent element var plug = document.getElementById('qtmovie_embed'); if ( null == plug ){ alert("QT plug-in not instantiated on load event\t"); return; } loaded(); myAddListener(plug, 'qt_play', progress); myAddListener(plug, 'qt_pause', hasStoped); myAddListener(plug, 'qt_ended', hasStoped); } .div1{ width: 60%; float: left; border: 1px dashed #000000; } .div2{ width: 35%; float: left; border: 1px dashed #000000; } .menunav{ background: #da1b1b; height: 38px; width: 317px; } .menunav .menutitle{ width: 90%; text-align: left; margin: 5px; font-family:'Comic Sans MS', 'san sarif', 'Arial'; font-size:25px; font-weight:bold; line-height: 38px; } .screennav{ background: #da1b1b; font-family:'Comic Sans MS', 'san sarif', 'Arial'; height: 38px; width: 317px; } .screennav .back{ margin-left:5px; opacity: 0; } .menu{ position: relative; height: 248px; width: 307px; border: 5px solid #da1b1b; overflow: hidden; } .episodes{ position: absolute; top: 0px; left: 307px; overflow: hidden; height: 248px; width: 307px; } .episodes .episodelist{ height: 248px; } .episodes .episodelist .episode{ height: 62px; width: 100%; border-bottom: dashed 1px #000000; font-size: 8px; } .episodes .episodelist .episode .image{ float: left; width:71px; height:62px; background: center no-repeat; margin-left: 5px; margin-right: 5px; } .episodes .episodelist .episode .episodeTitle{ float: left; width: 100px; text-align: left; font-size: 15px; } .episodes .episodelist .episode .container{ width: 100px; height: 55px; margin-right: 25px; overflow: hidden; float: left; } .episodes .episodelist .episode .container2{ width: 75px; margin-top: 7px; float: left; } .episodes .episodelist .episode .container2 .item_options{ padding-left: 20px; margin-bottom: 8px; height: 10px; line-height: 10px; float: left; clear: left; background: inherit; } .episodes .episodelist .episode .container .score{ float: left; clear: left; margin-left: -2px; height: 20px; width: 100px; background: url(mini-starrating.gif) left top repeat-x; } .episodes .episodelist .episode .container .score .rating{ float: left; height: 20px; width: inherit; background: url(mini-starrating.gif) left center repeat-x; } .episodes .episodelist .episode .container .views{ float: left; clear: left; width: 100px; } .episodeDetail{ position: absolute; top: 0px; left: 614px; overflow: hidden; height: 248px; width: 307px; } .episodeDetail .header{ border-bottom: 1px dashed #000000; height: 62px; } .episodeDetail .header .episode_info{ width: 220px; float: right; } .episodeDetail .header .episode_info .episode_title{ font-size: 15px; font-weight: bold; } .episodeDetail .header .episode_info .episode_season{ font-size: 8px; margin-bottom: 8px; } .episodeDetail .header .episode_info .score{ float: left; clear: left; margin-left: -2px; height: 20px; width: 100px; background: url(mini-starrating.gif) left top repeat-x; } .episodeDetail .header .episode_info .rating{ float: left; height: 20px; width: inherit; background: url(mini-starrating.gif) left center repeat-x; } .episodeDetail .header img{ margin-top: 5px; margin-left: 5px; margin-right: 5px; } .episodeDetail .episode_description{ margin: 0px 5px 0px 5px; height: 135px; overflow: hidden; } .episodeDetail .container{ width: 110px; margin-top: 4px; margin-left: auto; margin-right: auto; } .episodeDetail .container .button{ float: inherit; margin-top: -5px; height: 48px; width: 48px; } .seasons{ position: absolute; top: 0px; left: inherit; height: 248px; width: 307px; text-align: center; font-family:'Comic Sans MS', 'san sarif', 'Arial'; font-size:8px; font-weight:bold; line-height: 30px; } .seasons div{ border-bottom:1px dashed #000000; } .seasons div:hover, .episodes .episodelist div:hover{ background: #fcff01; } /* controlls */ .progresscontainer{ position: absolute; width:448px; height:42px; left:99px; top:5px; background: url(images/progressbar.png) repeat-x; } .timeline{ height: 42px; width: 100%; position: relative; } .timeline div{ width: 1px; height: 42px; float: left; } .pointer{ position: absolute; top: 0px; width: 1px; height: 42px; background: url(images/loadedprogressbar.png) repeat-x; } .controllbar { position: relative; width:644px; height: 67px; } .controllbar .stop { background: url(images/stop.png) no-repeat; position:absolute; left:0px; top:0px; width:46px; height:47px; } .controllbar .play { background: url(images/play.png) no-repeat; position:absolute; left:46px; top:0px; width:40px; height:47px; } .controllbar .frameleft { background: url(images/frameleft.png) no-repeat; position:absolute; left:86px; top:0px; width:13px; height:47px; } .controllbar .frametop { background: url(images/frametop.png) no-repeat; position:absolute; left:99px; top:0px; width:455px; height:5px; } .controllbar .pause { background: url(images/pause.png) no-repeat; position:absolute; left:554px; top:0px; width:45px; height:47px; } .controllbar .vol_plus { background: url(images/vol_plus.png) no-repeat; position:absolute; left:599px; top:0px; width:45px; height:24px; } .controllbar .frameright { background: url(images/frameright.png) no-repeat; position:absolute; left:547px; top:5px; width:7px; height:42px; } .controllbar .vol-7 { background: url(images/vol_7.png) no-repeat; position:absolute; left:599px; top:24px; width:45px; height:4px; } .controllbar .vol-6 { background: url(images/vol_6.png) no-repeat; position:absolute; left:599px; top:28px; width:45px; height:3px; } .controllbar .vol-5 { background: url(images/vol_5.png) no-repeat; position:absolute; left:599px; top:31px; width:45px; height:3px; } .controllbar .vol-4 { background: url(images/vol_4.png) no-repeat; position:absolute; left:599px; top:34px; width:45px; height:3px; } .controllbar .vol-3 { background: url(images/vol_3.png) no-repeat; position:absolute; left:599px; top:37px; width:45px; height:3px; } .controllbar .vol-2 { background: url(images/vol_2.png) no-repeat; position:absolute; left:599px; top:40px; width:45px; height:3px; } .controllbar .vol-1 { background: url(images/vol_1.png) no-repeat; position:absolute; left:599px; top:43px; width:45px; height:3px; } .controllbar .vol_minus { background: url(images/vol_minus.png) no-repeat; position:absolute; left:599px; top:46px; width:45px; height:21px; } .controllbar .framebottom { background: url(images/framebottom.png) no-repeat; position:absolute; left:0px; top:47px; width:599px; height:20px; } /* playlist */ .playlist{ width: 100%; height: 80px; border: 1px dashed #000000; float: left; } .playlist .option{ width: 70px; height: 70px; margin-top: 4px; margin-left: 10px; float: left; border: 1px dashed #000000; } Home Back
VIEWS ON THIS POST

88

Posted on:

Tuesday 27th November 2012
View Replies!

question: Javascript link to start another javascript

hi im new to this ive got a question is it possible to link an item to start another javascript possibly with an on click funktion so that the javascript only starts once you click an item on the navigation bar $(document).ready(function(){ $.uiPro({ leftMenu : { 'item1' : { 'label' : 'Item One', , */
VIEWS ON THIS POST

106

Posted on:

Wednesday 28th November 2012
View Replies!

Format : [LastName, FirstName MiddleInitial.] Regular Expression

I hate regular expressions, I have to say that. Anyway, I want to create a regular expression that checks if a string has this format: [FirstName], [LastName] [MiddleInitial]. I tried doing it like this : /\w+, \w+ [a-zA-Z]\./.test(this.value) failure. Can help
VIEWS ON THIS POST

68

Posted on:

Thursday 29th November 2012
View Replies!

comp.lang.javascript FAQ - Quick Answers 2008-01-21

comp.lang.javascript FAQ - Quick Answers- 9.88 - 2007-10-12 1 meta-FAQ meta-questions 2 comp.lang.javascript tips 2.1 Which newsgroups deal with javascript 2.2 What questions are off-topic for clj 2.3 What do I have to do before posting to clj 2.4 Why ...
VIEWS ON THIS POST

79

Posted on:

Friday 30th November 2012
View Replies!

xmldom getAttribute firefox problem

Hi all I am trying to get a url attribute from an xml node: I can do this in IE with the following code: var newDom = xmlhttp.responseXML; var x = newDom.getElementsByTagName("item"); var urlNode = ...
VIEWS ON THIS POST

103

Posted on:

Friday 30th November 2012
View Replies!

Scriptaculous - Sortable.create() bug

Im using Scriptaculous v1.7 to perform sortable drag drop. My display uses: Sortable.create('DocumentContainer_1',{tag:'div',onUpdate:SortUpdate, handle:'Gripper',constraint:false,scroll:window}); There are about 5 div blocks with gripper hanldes next to them. Drag drop sorting works fine. Later i perform an AJAX update within the child ...
VIEWS ON THIS POST

62

Posted on:

Friday 30th November 2012
View Replies!

move square in a route

>>>I need to move the coloured little square trought the 4lines.now i know they move just in the first line and take a solution using parent node and cellIndex to move to alla lines.example: if u start and u trow ...
VIEWS ON THIS POST

105

Posted on:

Friday 30th November 2012
View Replies!

Wanted: young AJAX programmer in London

Are you a young programmer with some experience in javascript, XML, HTML living in London Are you interested in a idea for an internet start-up Then respond to the email adress above. No spam. Dirk nachbar dot unimatch at gmail ...
VIEWS ON THIS POST

64

Posted on:

Friday 30th November 2012
View Replies!

For ... in loop over array not working as expected

I created this page and script to experiment with Javascript's constructor and prototyping, as well as the for...in loop, which has caused me trouble before. I am having a problem with the for loop: for(var s in this.sArr). I would like it to iterate over every entry in sArr, which is what I thought it would do, but s just assumes the value of each array index. If there are three strings added to sArr in the strings object, 0 1 2 just gets printed out. What is the correct way to iterate over every element of an array string Test function stringStore() { this.sArr = []; } stringStore.prototype.addString = function(s) { alert(s); this.sArr.push(s); } stringStore.prototype.return = function() { sbuilder = ""; for(var s in this.sArr) { alert(s); sbuilder += s; sbuilder += "\n"; } return sbuilder; } strings = new stringStore(); function addString() { strings.addString(document.getElementById("input").value); } function print() { document.getElementById("output").value = strings.return(); } input: add output: print
VIEWS ON THIS POST

140

Posted on:

Sunday 23rd December 2012
View Replies!

Passing Variables

I'm writing a non-refreshing registration page using a mix of jQuery and regular Javascript. I gather the data from input fields, store it in variables, and then pass the variables to another function which use the jQuery $.post function for ajax to send the variables to a PHP script that submits them to a MySql database. The problem is the PHP script doesn't seem to be getting any data at all. Now I think my problem comes up when I pass the variables to the function register. function getContent() { //Get Values for each form field username=document.getElementById('user').value; password=document.getElementById('pass').value; verify=document.getElementById('verify').value; email=document.getElementById('email').value; register(username, password, email); } function register(username, password, email) { $('#registerForm').hide('medium'); $('#loading').show('medium'); $.post("register.php", {username: username, password: password, email: email}, function(data) { //code that deals with return data }); } Any ideas This post has been edited by Gamegoofs2: 05 April 2010 - 12:08 PM
VIEWS ON THIS POST

68

Posted on:

Sunday 23rd December 2012
View Replies!

Sortable Table Incorrectly sorting date column

Hi all, I'm fairly new to Javascript, and found a script here that allows for sortable tables in HTML, and for the most part, it works great. But with my date field, it either sorts alphabetically (Aug->Sept), or, if I change Names to Numbers (Jan=1, Feb=2, etc) the sort order becomes 1, 10, 2, 3, 4, 5, 6, 7, 8, 9 (I only have Jan-Oct dates). I think I have to tell my script to interpret my numbered dates as text, but like I said I'm new to JS and wouldn't know where to begin. Javascript (from http://www.webtoolki...html-table.html) // Javascript Document /** * * Sortable HTML table * http://www.webtoolkit.info/ * **/ function SortableTable (tableEl) { this.tbody = tableEl.getElementsByTagName('tbody'); this.thead = tableEl.getElementsByTagName('thead'); this.tfoot = tableEl.getElementsByTagName('tfoot'); this.getInnerText = function (el) { if (typeof(el.textContent) != 'undefined') return el.textContent; if (typeof(el.innerText) != 'undefined') return el.innerText; if (typeof(el.innerHTML) == 'string') return el.innerHTML.replace(//g,''); } this.getParent = function (el, pTagName) { if (el == null) return null; else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) return el; else return this.getParent(el.parentNode, pTagName); } this.sort = function (cell) { var column = cell.cellIndex; var itm = this.getInnerText(this.tbody[0].rows[1].cells[column]); var sortfn = this.sortCaseInsensitive; if (itm.match(/\d\d[-]+\d\d[-]+\d\d\d\d/)) sortfn = this.sortDate; // date format mm-dd-yyyy if (itm.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/)) sortfn = this.sortNumeric; this.sortColumnIndex = column; var newRows = new Array(); for (j = 0; j < this.tbody[0].rows.length; j++) { newRows[j] = this.tbody[0].rows[j]; } newRows.sort(sortfn); if (cell.getAttribute("sortdir") == 'down') { newRows.reverse(); cell.setAttribute('sortdir','up'); } else { cell.setAttribute('sortdir','down'); } for (i=0;i
VIEWS ON THIS POST

42

Posted on:

Sunday 23rd December 2012
View Replies!

Javascript in [URL] tag

Can you make it so we can put "java script:...." inside [URL] tag Also why does it split the java$cript into 2 words when you post it This post has been edited by okyup: 09 November 2006 - 11:07 AM
VIEWS ON THIS POST

77

Posted on:

Monday 24th December 2012
View Replies!

jQuery UI tabs - JavaScript Help

HiI have the following code that has been rendered using php, but I am trying to use the jquery ui tabs, I have used the same code and files that are used on the demo of the tabs from the jquery site, but the tabs do not display. Trade-Bidz $(function() { $( "#tabs" ).tabs(); }); Logout Home Buying Selling Contact Us Terms My Trade-Bidz How It Works Search Items Make: Please select... MGRENAULT Model: Select Make Style: Ending Soon There are no lots completing today Other Selected Lots RENAULT SCENIC Expression 16V A Current Bid: £2133 Time Left: Countdown will go here View Lot MG ZR Current Bid: £1213 Time Left: Countdown will go here View Lot MG ZR Current Bid: £12 Time Left: Countdown will go here View Lot Buying Selling6 Watching0 Messages Profile Active Items You are Selling Reg NumberMake ModelEnd DateReserveCurrent BidCurrent High Budder0 RENAULT SCENIC Expression 16V A MPV 2011-09-20 3344.00 3434 42Ended You currently have not vehicle available for auction. To sell a vehicle click here You are currently not watching any items Trader Name:New Dealer Address:17 Stonehenge CroftBirminghamWest MidlandsB14 5PL Phone Number:01214745928 Feedback Feedback will appear here Any ideas why the tabs do not display
VIEWS ON THIS POST

76

Posted on:

Friday 28th December 2012
View Replies!

Javascript popups within PHP if statement - JavaScript Help

How would I implement a javascript confirm box within a PHP if statment I have an if statement, and if it is true, I want a confirm box to pop up asking the user if they would like continue, or cancel the operation and go back. If they click yes, it should continue with the rest of the script. If no, it will simpily redirect back to the first page. If the if statement is false all together, it just skips that step and moves on to the next else statment. I have the entire php script working, it's just the confirm box I want to implement so the user doesn't unexpectedly have something happen they don't want to happen. Otherwise, the script will just continue without asking the user anything, and they might not want that.
VIEWS ON THIS POST

77

Posted on:

Monday 31st December 2012
View Replies!

Disabled Question - JavaScript Help

document.getElementById("LS").disabled="true";-Worksdocument.getElementById('LS').disabled="false";-Failsdocument.getElementById('LS').disabled=false;-Works-Why\t
VIEWS ON THIS POST

71

Posted on:

Tuesday 1st January 2013
View Replies!

NIC EDIT help - JavaScript Help

i am using nic edit on my text area which all is working expect for when i use the add link buttonwhen i add a link it just displays javascript:nicTemp(); and not the link i think this is part of there code that does not work they havent made it eazy to read var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
VIEWS ON THIS POST

72

Posted on:

Wednesday 2nd January 2013
View Replies!

innerhtml - JavaScript Help

Im trying to get an innerhtml value to increment by 1 function up(){ document.getElementById("cnt").innerHTML = document.getElementById('cnt') + 1; } 0 Go up
VIEWS ON THIS POST

47

Posted on:

Wednesday 2nd January 2013
View Replies!

FULL PAGE ZOOM (unsure of what coding) - JavaScript Help

Hi I am wanting to create a ull page zoom effect and not surewhich language would be best to develop this. Basically want to create a which will replicate the ctrl + or Ctrl - effect in all browsers. Can any one help me please
VIEWS ON THIS POST

244

Posted on:

Wednesday 2nd January 2013
View Replies!

jquery/ajax/loading objects question... - JavaScript Help

if I am loading content into a div using the get feature of jquery, and that content has some clickable objects in it will jquery recognize those as well What I am doing is building a site that tracks bugs on our software. The site pulls the bugs from a mysql db and displays in a table format. There's an edit link which passes the record id number of that bug (via ajax) to a php file, where a form is filled in with the bug data and passed back, a hidden div is then shown with the form in it. Part of the code I pass back has a submit button and a close button (css styled anchors) and I'm using the same process on them as I am on the edit link but not getting any results. My script looks like this: $(document).ready(function(){ //hide edit form $('#editform').hide(); //toggle bug description $("a.clickable").click(function(){ if ($('#' + $(this).attr('opendesc') + '_bottom').is(':visible')) { //alert($(this).attr('opendesc')); $('#' + $(this).attr('opendesc') + '_bottom').hide('slow'); } else { $('#' + $(this).attr('opendesc') + '_bottom').show('slow'); } }); //close bug description $("a.btnClose").click(function(){ //alert($(this).attr('closedesc')); $('#' + $(this).attr('closedesc')).hide('slow'); }); //close edit window -- not working $("a.btnCloseEdit").click(function(){ alert("you are here!"); $('#editform').hide(); }); //use ajax to load edit bug form $("a.edit").click(function(){ //get item id var itemid = $(this).attr('itemid'); //load edit form data $.get('lib/editform.php', {thisid: itemid}, function(data) { $('#editform').html(data); //alert('Load was performed.'); }); //show edit form $('#editform').show('show'); }); $("a.btnCloseEdit").click(function() { alert("k"); }); }); the last click function, where I'm just posting an alert, binds back to this code, which is on the page being loaded in the ajax call: //other code SubmitX //other code I'm a noob with jquery and not sure how it works. Does it sneak peek the page after it loads and get all the objects into some sort of array I'm thinking it is doing that and because I am adding other object through AJAX it is not seeing those, since the page is not being reloaded. Am I missing something here
VIEWS ON THIS POST

306

Posted on:

Wednesday 2nd January 2013
View Replies!