Jump to content

random1

Members
  • Posts

    425
  • Joined

  • Last visited

Everything posted by random1

  1. I've looked through Javascript validation scripts but all the ones I've found cover validation upon submition. I'm looking at entry point protect against wrong chracters. E.g. - Preventing all characters from being entered except numbers. - Preveting all chracters except upper case and lower case letters - Requiring that the chracters enter match a pattern (e.g. DD-MM-YYYY) etc... (Yes I have PHP code after to check all field data, I just want some nice front-end validation to filter out the bad entry straight up) Any Ideas?
  2. That's just it I don't have duplicate usernames. The result set I get without "DISTINCT" returns the duplicate row for the number of users in the table. e.g. username DATE username DATE username DATE ... ... ... 103 times. Any ideas?
  3. I have the following stored procedure in my db: DELIMITER // CREATE DEFINER=`root`@`localhost` PROCEDURE `procedure_update_user`(IN `user_username` VARCHAR(25)) COMMENT 'Updates the ''user'' table' BEGIN UPDATE `user` SET `user_datetime_utc_last_login` = UTC_TIMESTAMP() WHERE `user_username` = user_username; SELECT `user_username`, `user_datetime_utc_last_login` FROM `user` WHERE `user_username` = user_username; END// DELIMITER ; But when I run: CALL procedure_update_user('user1'); It's supposed to return one row but it returns all user rows. Do I have to use "DISTINCT" for the SELECT statement?
  4. Hey All, How do you override PHP methods in PHP? I'd like to override 'strtolower' with a utf-8 compliant method. Do I simply redeclare the function with new logic?
  5. Found it! In my code all page output is from a buffer that is UTF-8. I changed part of my code from: // Encode HTML to UTF-8 if($htmlencode == true) { // HTML is not UTF-8 Encoded if(mb_detect_encoding($buffer) != 'UTF-8' || mb_detect_encoding($buffer) != 'UTF8') { // Enforce UTF-8 Encoding $buffer = utf8_encode($buffer); } } to: // Encode HTML to UTF-8 if($htmlencode == true) { // HTML is not UTF-8 Encoded if(mb_detect_encoding($buffer) != 'UTF-8') { // Enforce UTF-8 Encoding $buffer = utf8_encode($buffer); } } Thanks for replying
  6. Hi All, I've set up my site with UTF-8 but occasionally when I view the site I have incorrect characters appearing like: In the above example the left is arabic characters and the right is korean. The browser I'm using is Firefox. Any ideas?
  7. Seems like it was a cache issue in the browser.. I cleared the cache and it seems fine.
  8. Hey all, I have expiring content and etags configured for my apache installation using .htaccess. But the file 'favicon.ico' does has an etag and no expiry date. My code segment: # Expire content <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "now" ExpiresByType text/html "now" ExpiresByType text/xml "now" ExpiresByType text/php "access plus 1 years" ExpiresByType text/css "access plus 1 years" ExpiresByType text/javascript "access plus 1 years" ExpiresByType application/javascript "access plus 1 years" ExpiresByType application/x-javascript "access plus 1 years" ExpiresByType text/ecmascript "access plus 1 years" ExpiresByType image/gif "access plus 1 years ExpiresByType image/png "access plus 1 years" ExpiresByType image/jpeg "access plus 1 years" ExpiresByType image/ico "access plus 1 years" ExpiresByType image/icon "access plus 1 years" ExpiresByType image/x-icon "access plus 1 years" ExpiresByType video/x-flv "access plus 1 years" ExpiresByType video/quicktime "access plus 1 years" ExpiresByType application/x-shockwave-flash "access plus 1 years" ExpiresByType application/pdf "access plus 1 years" <FilesMatch "\.(png|jpg|gif|css|flv|ico)$"> Header set Cache-Control "max-age=290304000, public" </FilesMatch> <FilesMatch "\.(php|html)$"> Header set Cache-Control "max-age=0, must-revalidate" </FilesMatch> </IfModule> Any ideas?
  9. I have my stylesheet containing: * { font-size:62.5%; /* sets 1em = 10px */ } body { font-size:1.5em; /* sets default font size to 15px */ } I then have in my HTML tags within the body tag like 'p' and 'div' but these remain tiny (1em or 10px). How can I make it so that all content within the body tag inherits the font-size defined (1.5em)? Is there a better way of doing this?
  10. Hey All, I'm trying to set up a consistant rule for my stylehseet's sizing. For all measurements I wish to use em instead of px or %. Is this a good idea? Any drawbacks for doing this? Do all browsers accept em as a measurement? E.g. I've set my body selector to: font-size:0.875em; Refferred Source: http://pxtoem.com/ SIZINGS: Pixels EMs Percent Points 6px 0.429em 42.9% 5pt 7px 0.5em 50% 5pt 8px 0.571em 57.1% 6pt 9px 0.643em 64.3% 7pt 10px 0.714em 71.4% 8pt 11px 0.786em 78.6% 8pt 12px 0.857em 85.7% 9pt 13px 0.929em 92.9% 10pt 14px 1em 100% 11pt 15px 1.071em 107.1% 11pt 16px 1.143em 114.3% 12pt 17px 1.214em 121.4% 13pt 18px 1.286em 128.6% 14pt 19px 1.357em 135.7% 14pt 20px 1.429em 142.9% 15pt 21px 1.5em 150% 16pt 22px 1.571em 157.1% 17pt 23px 1.643em 164.3% 17pt 24px 1.714em 171.4% 18pt
  11. Hey, Among my HTML code I have <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-au" lang="en-au" dir="ltr"> AND <body lang="en-au" dir="ltr"> Do I need to specify lang and dir for for both elements to affect the language and text-dir for the document?
  12. I currently am using a php file 'stylesheet.php' that echos out a validated CSS content for my site. I want to write the CSS content to a file 'stylesheet-public.css'. I've tried: http://php.net/manual/en/function.eval.php but it does not work since the PHP content has multiple opening and closing tags (<?php ?>). Any other ideas?
  13. I ended up with: <?php function random_hex_color($max_r = 255, $max_g = 255, $max_b = 255) { // ensure that values are in the range between 0 and 255 if ($max_r > 255) { $max_r = 255; } if ($max_g > 255) { $max_g = 255; } if ($max_b > 255) { $max_b = 255; } if ($max_r < 0) { $max_r = 0; } if ($max_g < 0) { $max_g = 0; } if ($max_b < 0) { $max_b = 0; } // generate and return the random color return dechex(rand(0, $max_r)) . dechex(rand(0, $max_g)) . dechex(rand(0, $max_b)); } echo('<table>' . "\n"); for($i = 0; $i < 500; $i++) { $hex = random_hex_color(); echo('<tr height="40px">' . "\n"); echo('<td width="40px" bgcolor="#' . $hex . ';"> </td>'); echo('<td width="120px"> #' . $hex . '</td>'); echo('</tr>'); } echo("\n" . '</table>'); ?>
  14. How can you create a HTML Hex Color Chart using PHP to generate it? Such as: http://www.immigration-usa.com/html_colors.html So far I have the code: <?php function random_hex_color() { return sprintf("%02X%04X%02X", mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)); } echo('<table>' . "\n"); for($i = 0; $i < 500; $i++) { $hex = random_hex_color(); echo('<tr>' . "\n"); echo('<td bgcolor="#' . $hex . ';">#' . $hex . '</td>'); echo('</tr>'); } echo("\n" . '</table>'); ?> but is not random enough. I'd like it so that is shades or each color ; red, yellow, blue, green, black.
  15. Hey All, I've got: I've got a few issues with getting autocomplete working for input fields. I have a script: (Code from: http://wick.sourceforge.net/) /* WICK: Web Input Completion Kit http://wick.sourceforge.net/ Copyright (c) 2004, Christopher T. Holland All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Christopher T. Holland, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* start dhtml building blocks */ function freezeEvent(e) { if (e.preventDefault) e.preventDefault(); e.returnValue = false; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); return false; }//freezeEvent function isWithinNode(e,i,c,t,obj) { answer = false; te = e; while(te && !answer) { if ((te.id && (te.id == i)) || (te.className && (te.className == i+"Class")) || (!t && c && te.className && (te.className == c)) || (!t && c && te.className && (te.className.indexOf(c) != -1)) || (t && te.tagName && (te.tagName.toLowerCase() == t)) || (obj && (te == obj)) ) { answer = te; } else { te = te.parentNode; } } return te; }//isWithinNode function getEvent(event) { return (event ? event : window.event); }//getEvent() function getEventElement(e) { return (e.srcElement ? e.srcElement: (e.target ? e.target : e.currentTarget)); }//getEventElement() function findElementPosX(obj) { curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent; } }//if offsetParent exists else if (obj.x) curleft += obj.x return curleft; }//findElementPosX function findElementPosY(obj) { curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } }//if offsetParent exists else if (obj.y) curtop += obj.y return curtop; }//findElementPosY /* end dhtml building blocks */ function handleKeyPress(event) { e = getEvent(event); eL = getEventElement(e); upEl = isWithinNode(eL,null,"wickEnabled",null,null); kc = e["keyCode"]; if (siw && ((kc == 13) || (kc == 9))) { siw.selectingSomething = true; if (siw.isSafari) siw.inputBox.blur(); //hack to "wake up" safari siw.inputBox.focus(); siw.inputBox.value = siw.inputBox.value.replace(/[ \r\n\t\f\s]+$/gi,' '); hideSmartInputFloater(); } else if (upEl && (kc != 38) && (kc != 40) && (kc != 37) && (kc != 39) && (kc != 13) && (kc != 27)) { if (!siw || (siw && !siw.selectingSomething)) { processSmartInput(upEl); } } else if (siw && siw.inputBox) { siw.inputBox.focus(); //kinda part of the hack. } }//handleKeyPress() function handleKeyDown(event) { e = getEvent(event); eL = getEventElement(e); if (siw && (kc = e["keyCode"])) { if (kc == 40) { siw.selectingSomething = true; freezeEvent(e); if (siw.isGecko) siw.inputBox.blur(); /* Gecko hack */ selectNextSmartInputMatchItem(); } else if (kc == 38) { siw.selectingSomething = true; freezeEvent(e); if (siw.isGecko) siw.inputBox.blur(); selectPreviousSmartInputMatchItem(); } else if ((kc == 13) || (kc == 9)) { siw.selectingSomething = true; activateCurrentSmartInputMatch(); freezeEvent(e); } else if (kc == 27) { hideSmartInputFloater(); freezeEvent(e); } else { siw.selectingSomething = false; } } }//handleKeyDown() function handleFocus(event) { e = getEvent(event); eL = getEventElement(e); if (focEl = isWithinNode(eL,null,"wickEnabled",null,null)) { if (!siw || (siw && !siw.selectingSomething)) processSmartInput(focEl); } }//handleFocus() function handleBlur(event) { e = getEvent(event); eL = getEventElement(e); if (blurEl = isWithinNode(eL,null,"wickEnabled",null,null)) { if (siw && !siw.selectingSomething) hideSmartInputFloater(); } }//handleBlur() function handleClick(event) { e2 = getEvent(event); eL2 = getEventElement(e2); if (siw && siw.selectingSomething) { selectFromMouseClick(); } }//handleClick() function handleMouseOver(event) { e = getEvent(event); eL = getEventElement(e); if (siw && (mEl = isWithinNode(eL,null,"matchedSmartInputItem",null,null))) { siw.selectingSomething = true; selectFromMouseOver(mEl); } else if (isWithinNode(eL,null,"siwCredit",null,null)) { siw.selectingSomething = true; }else if (siw) { siw.selectingSomething = false; } }//handleMouseOver function showSmartInputFloater() { if (!siw.floater.style.display || (siw.floater.style.display=="none")) { if (!siw.customFloater) { x = findElementPosX(siw.inputBox); y = findElementPosY(siw.inputBox) + siw.inputBox.offsetHeight; //hack: browser-specific adjustments. if (!siw.isGecko && !siw.isWinIE) x += 8; if (!siw.isGecko && !siw.isWinIE) y += 10; siw.floater.style.left = x; siw.floater.style.top = y; } else { //you may //do additional things for your custom floater //beyond setting display and visibility } siw.floater.style.display="block"; siw.floater.style.visibility="visible"; } }//showSmartInputFloater() function hideSmartInputFloater() { if (siw) { siw.floater.style.display="none"; siw.floater.style.visibility="hidden"; siw = null; }//siw exists }//hideSmartInputFloater function processSmartInput(inputBox) { if (!siw) siw = new smartInputWindow(); siw.inputBox = inputBox; classData = inputBox.className.split(" "); siwDirectives = null; for (i=0;(!siwDirectives && classData[i]);i++) { if (classData[i].indexOf("wickEnabled") != -1) siwDirectives = classData[i]; } if (siwDirectives && (siwDirectives.indexOf(":") != -1)) { siw.customFloater = true; newFloaterId = siwDirectives.split(":")[1]; siw.floater = document.getElementById(newFloaterId); siw.floaterContent = siw.floater.getElementsByTagName("div")[0]; } setSmartInputData(); if (siw.matchCollection && (siw.matchCollection.length > 0)) selectSmartInputMatchItem(0); content = getSmartInputBoxContent(); if (content) { modifySmartInputBoxContent(content); showSmartInputFloater(); } else hideSmartInputFloater(); }//processSmartInput() function smartInputMatch(cleanValue, value) { this.cleanValue = cleanValue; this.value = value; this.isSelected = false; }//smartInputMatch function simplify(s) { return s.toLowerCase().replace(/^[ \s\f\t\n\r]+/,'').replace(/[ \s\f\t\n\r]+$/,''); //.replace(/[Ž,,,‘,\u00E9,\u00E8,\u00EA,\u00EB]/gi,"e").replace(/[ˆ,‰,\u00E0,\u00E2]/gi,"a"). }//simplify function getUserInputToMatch(s) { a = s; fields = s.split(","); if (fields.length > 0) a = fields[fields.length - 1]; return a; }//getUserInputToMatch function getUserInputBase() { s = siw.inputBox.value; a = s; if ((lastComma = s.lastIndexOf(",")) != -1) { a = a.replace(/^(.*\,[ \r\n\t\f\s]*).*$/i,'$1'); } else a = ""; return a; }//getUserInputBase() function runMatchingLogic(userInput, standalone) { userInput = simplify(userInput); uifc = userInput.charAt(0).toLowerCase(); if (uifc == '"') uifc = (n = userInput.charAt(1)) ? n.toLowerCase() : "z"; if (standalone) userInput = uifc; if (siw) siw.matchCollection = new Array(); pointerToCollectionToUse = collection; if (siw && siw.revisedCollection && (siw.revisedCollection.length > 0) && siw.lastUserInput && (userInput.indexOf(siw.lastUserInput) == 0)) { pointerToCollectionToUse = siw.revisedCollection; } else if (collectionIndex[userInput] && (collectionIndex[userInput].length > 0)) { pointerToCollectionToUse = collectionIndex[userInput]; } else if (collectionIndex[uifc] && (collectionIndex[uifc].length > 0)) { pointerToCollectionToUse = collectionIndex[uifc]; } else if (siw && (userInput.length == 1) && (!collectionIndex[uifc])) { siw.buildIndex = true; } else if (siw) { siw.buildIndex = false; } tempCollection = new Array(); re1m = new RegExp("^([ \"\>\<\-]*)("+userInput+")","i"); re2m = new RegExp("([ \"\>\<\-]+)("+userInput+")","i"); re1 = new RegExp("^([ \"\}\{\-]*)("+userInput+")","gi"); re2 = new RegExp("([ \"\}\{\-]+)("+userInput+")","gi"); for (i=0,j=0;(i<pointerToCollectionToUse.length);i++) { displayMatches = ((!standalone) && (j < siw.MAX_MATCHES)); entry = pointerToCollectionToUse[i]; mEntry = entry; if (!standalone && (mEntry.indexOf(userInput) == 0)) { userInput = userInput.replace(/\>/gi,'\\}').replace(/\< ?/gi,'\\{'); re = new RegExp("(" + userInput + ")","i"); if (displayMatches) { siw.matchCollection[j] = new smartInputMatch(entry, mEntry.replace(/\>/gi,'}').replace(/\< ?/gi,'{').replace(re,"<b>$1</b>")); } tempCollection[j] = entry; j++; } else if (mEntry.match(re1m) || mEntry.match(re2m)) { if (!standalone && displayMatches) { siw.matchCollection[j] = new smartInputMatch(entry, mEntry.replace(/\>/gi,'}').replace(/\</gi,'{').replace(re1,"$1<b>$2</b>").replace(re2,"$1<b>$2</b>")); } tempCollection[j] = entry; j++; } }//loop thru collection if (siw) { siw.lastUserInput = userInput; siw.revisedCollection = tempCollection.join(",").split(","); collectionIndex[userInput] = tempCollection.join(",").split(","); } if (standalone || siw.buildIndex) { collectionIndex[uifc] = tempCollection.join(",").split(","); if (siw) siw.buildIndex = false; } }//runMatchingLogic function setSmartInputData() { if (siw) { orgUserInput = siw.inputBox.value; orgUserInput = getUserInputToMatch(orgUserInput); userInput = orgUserInput.toLowerCase().replace(/[\r\n\t\f\s]+/gi,' ').replace(/^ +/gi,'').replace(/ +$/gi,'').replace(/ +/gi,' ').replace(/\\/gi,'').replace(/\[/gi,'').replace(/\(/gi,'').replace(/\./gi,'\.').replace(/\?/gi,''); if (userInput && (userInput != "") && (userInput != '"')) { runMatchingLogic(userInput); }//if userinput not blank and is meaningful else { siw.matchCollection = null; } }//siw exists ... uhmkaaayyyyy }//setSmartInputData function getSmartInputBoxContent() { a = null; if (siw && siw.matchCollection && (siw.matchCollection.length > 0)) { a = ''; for (i = 0;i < siw.matchCollection.length; i++) { selectedString = siw.matchCollection[i].isSelected ? ' selectedSmartInputItem' : ''; a += '<p class="matchedSmartInputItem' + selectedString + '">' + siw.matchCollection[i].value.replace(/\{ */gi,"<").replace(/\} */gi,">") + '</p>'; }// }//siw exists return a; }//getSmartInputBoxContent function modifySmartInputBoxContent(content) { //todo: remove credits 'cuz no one gives a shit ;] - done siw.floaterContent.innerHTML = '<div id="smartInputResults">' + content + (siw.showCredit ? ('<p class="siwCredit">Powered By: <a target="PhrawgBlog" href="http://chrisholland.blogspot.com/?from=smartinput&ref='+escape(location.href)+'">Chris Holland</a></p>') : '') +'</div>'; siw.matchListDisplay = document.getElementById("smartInputResults"); }//modifySmartInputBoxContent() function selectFromMouseOver(o) { currentIndex = getCurrentlySelectedSmartInputItem(); if (currentIndex != null) deSelectSmartInputMatchItem(currentIndex); newIndex = getIndexFromElement(o); selectSmartInputMatchItem(newIndex); modifySmartInputBoxContent(getSmartInputBoxContent()); }//selectFromMouseOver function selectFromMouseClick() { activateCurrentSmartInputMatch(); siw.inputBox.focus(); hideSmartInputFloater(); }//selectFromMouseClick function getIndexFromElement(o) { index = 0; while(o = o.previousSibling) { index++; }// return index; }//getIndexFromElement function getCurrentlySelectedSmartInputItem() { answer = null; for (i = 0; ((i < siw.matchCollection.length) && !answer) ; i++) { if (siw.matchCollection[i].isSelected) answer = i; }// return answer; }//getCurrentlySelectedSmartInputItem function selectSmartInputMatchItem(index) { siw.matchCollection[index].isSelected = true; }//selectSmartInputMatchItem() function deSelectSmartInputMatchItem(index) { siw.matchCollection[index].isSelected = false; }//deSelectSmartInputMatchItem() function selectNextSmartInputMatchItem() { currentIndex = getCurrentlySelectedSmartInputItem(); if (currentIndex != null) { deSelectSmartInputMatchItem(currentIndex); if ((currentIndex + 1) < siw.matchCollection.length) selectSmartInputMatchItem(currentIndex + 1); else selectSmartInputMatchItem(0); } else { selectSmartInputMatchItem(0); } modifySmartInputBoxContent(getSmartInputBoxContent()); }//selectNextSmartInputMatchItem function selectPreviousSmartInputMatchItem() { currentIndex = getCurrentlySelectedSmartInputItem(); if (currentIndex != null) { deSelectSmartInputMatchItem(currentIndex); if ((currentIndex - 1) >= 0) selectSmartInputMatchItem(currentIndex - 1); else selectSmartInputMatchItem(siw.matchCollection.length - 1); } else { selectSmartInputMatchItem(siw.matchCollection.length - 1); } modifySmartInputBoxContent(getSmartInputBoxContent()); }//selectPreviousSmartInputMatchItem function activateCurrentSmartInputMatch() { baseValue = getUserInputBase(); if ((selIndex = getCurrentlySelectedSmartInputItem()) != null) { addedValue = siw.matchCollection[selIndex].cleanValue; theString = (baseValue ? baseValue : "") + addedValue + ", "; siw.inputBox.value = theString; runMatchingLogic(addedValue, true); } }//activateCurrentSmartInputMatch function smartInputWindow () { this.customFloater = false; this.floater = document.getElementById("smartInputFloater"); this.floaterContent = document.getElementById("smartInputFloaterContent"); this.selectedSmartInputItem = null; this.MAX_MATCHES = 5; this.isGecko = (navigator.userAgent.indexOf("Gecko/200") != -1); this.isSafari = (navigator.userAgent.indexOf("Safari") != -1); this.isWinIE = ((navigator.userAgent.indexOf("Win") != -1 ) && (navigator.userAgent.indexOf("MSIE") != -1 )); this.showCredit = false; }//smartInputWindow Object function registerSmartInputListeners() { inputs = document.getElementsByTagName("input"); texts = document.getElementsByTagName("textarea"); allinputs = new Array(); z = 0; y = 0; while(inputs[z]) { allinputs[z] = inputs[z]; z++; }// while(texts[y]) { allinputs[z] = texts[y]; z++; y++; }// for (i=0; i < allinputs.length;i++) { if ((c = allinputs[i].className) && (c == "wickEnabled")) { allinputs[i].setAttribute("autocomplete","OFF"); allinputs[i].onfocus = handleFocus; allinputs[i].onblur = handleBlur; allinputs[i].onkeydown = handleKeyDown; allinputs[i].onkeyup = handleKeyPress; } }//loop thru inputs }//registerSmartInputListeners siw = null; if (document.addEventListener) { document.addEventListener("keydown", handleKeyDown, false); document.addEventListener("keyup", handleKeyPress, false); document.addEventListener("mouseup", handleClick, false); document.addEventListener("mouseover", handleMouseOver, false); } else { document.onkeydown = handleKeyDown; document.onkeyup = handleKeyPress; document.onmouseup = handleClick; document.onmouseover = handleMouseOver; } registerSmartInputListeners(); document.write ( '<table id="smartInputFloater" class="floater" cellpadding="0" cellspacing="0"><tr><td id="smartInputFloaterContent" nowrap="nowrap">' +'<\/td><\/tr><\/table>' ); //note: instruct users to the fact that no commas should be present in entries. //it would make things insanely messy. //this is why i'm filtering commas here: for (x=0;x<collection.length;x++) { collection[x] = collection[x].replace(/\,/gi,''); }// collectionIndex = new Array(); ds = ""; function debug(s) { ds += ( s + "\n"); } Currently I am passing the JavaScript array: collection = ['David', 'Dean', 'Dickson', '詹姆斯', 'Larry', 'Dan', 'Davy', 'Zoro', 'Scott', 'Ave', 'Street', 'Parade']; When I type 'd' is dropping down the correct items But when I type 詹 (chinese) it does not drop down the item '詹姆斯'. How can I add utf-8 characters to be accepted as input searches? Also how can I change the behaviour of appending a ',' to accept spaces so that I could type the address '24 River Ave' into a text box and get two autocomplete drop downs (River and Ave)? Help is much appreciated
  16. I have created my own CMS from the ground up with heaps of great features I'd like to implement an "Addons" or "Plugins" feature so that the administrator can enable/disable and customize an "Addon" to suit their website. For example an "Addon" called "EzyBasket" could be created that changes the appearence of the shopping basket to be columns instead of rows.. etc.. Anyone have a good way of implementing 'addon' logic into an app. It's best of it's at a low level include?
  17. Is it worthwhile serving images from a subdomain(s)? Is this a myth? i.e. domain.com has "images.domain.com"
  18. Got this fixed... buffer was not being passed further through code :< . fixed
  19. Hey All, I have the following code ($buffer is a string of all output for the page): $config = array('indent' => true, 'fix-uri' => true, 'wrap' => '1000'); /* Sources: http://tidy.sourceforge.net/docs/quickref.html#fix-backslash http://php.net/manual/en/book.tidy.php */ // Tidy $tidy = new tidy(); $tidy->parseString($buffer, $config, 'utf8'); $tidy->cleanRepair(); $buffer = tidy_get_output($tidy); [The tidy extension is enabled in my php.ini file] This produces $buffer being empty at the end with no output (no error). Is this how the 'tidy' extension is used? And ideas?
  20. * select:hover * textarea:hover * input[type=text]:hover * input[type=password]:hover * select:hover * .topbarfield:hover * .userprofileselect:hover The main reason I'm using :hover on these elements is because I want to show state and position on input elements. For example you hover over a field the background colour changes and cursor so that you can easily tell which form field you are on (or have focus on). That kinda thing.
  21. I'm making my web app skinny, optimized. For CSS I'm testing using Google Page Speed, Results: stylesheet.css has 0 very inefficient rules, 0 inefficient rules, and 7 potentially inefficient uses of :hover out of 199 total rules. Rules that use the :hover pseudo-selector on non-anchor elements. This can cause performance problems in Internet Explorer versions 7 and 8 when a strict doctype is used. * select:hover * textarea:hover * input[type="text"]:hover * input[type="password"]:hover * select:hover * .topbarfield:hover * .userprofileselect:hover How can this be resolved? Any ideas? I'm using XHTML 1.0 Strict as a DOCTYPE.
  22. How can you get the number of feed subscribers? What I'm looking for: - The total count of views for all users for the current month - The unique count of subscribers to a feed for the current month On my site the rss feed is: feeds/news.xml
  23. I'm making the switch to HTML5 on my site and have an issue the line: <html lang="en-au" xml:lang="en-au"> Vlidation Error message: The 'xmlns' attribute for this tag is missing What is the xmlns value need for this?
  24. Thanks guys... hope this helps speed up a bit
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.