Keyboard Face

when you find QWERTY imprinted on your cheek - it's time to go to bed.

Tags

asp CSS css menus dreamweaver flash gallery2 hosting iis7 Javascript jquery jquery ui left mac mssql os9 php printer rdp SEO sql sql server windows wordpress

Archives for November 2005

VBScript Array Length

November 21, 2005 by Tom 12 Comments

Apparently there is no direct method to determine the length of an array in VBScript. The best way I could find is to use UBound(ArrayName). This will return the upper limit of the array. Unfortunately, it doesn’t account for empty items in the array. In the example below Length will be equal to 10, not 1.

Dim NewArray(10)
NewArray(0) = "Apple"
Length = UBound(NewArray) 'Length is equal to 10, not 1

Here is a good link to VBScript Array functions.

http://www.shocknet.org.uk/defpage.asp?pageID=30

If you know of a better way to determine the length, please let me know.

Filed Under: Classic ASP, VBScript

Javascript InStr function

November 15, 2005 by Tom


Is there a function in Javascript that is the same as VBScript’s instr? Yes! It’s string.indexOf

For info on how to use it, check out DevGuru’s page on IndexOf

Filed Under: Javascript

Replacing Checkboxes and Radio Button’s Programmically with Javascript

November 14, 2005 by Tom 3 Comments

There is a great article and javascript on CodeProject.com. The code was originally written by BrainError.

I had to add support for labels, however. If you had a label like this:
<label for="CheckBoxID"></label>

it wouldn’t update the image if you clicked it. I added the following to the js file:

In function replaceChecks, I added one line: inputs[i].onclick = new Function(‘imgChange(‘+i+’)’);

Here’s the relevant section of code:

//set image
if(!inputs[i].disabled) {
img.onclick = new Function('checkChange('+i+')');
inputs[i].onclick = new Function('imgChange('+i+')');
}

I also had to add a separate function here:


//change the image if the checkbox is changed.
function imgChange(i) {

if(inputs[i].checked) {
document.getElementById('checkImage'+i).src=imgCheckboxTrue;
} else {
document.getElementById('checkImage'+i).src=imgCheckboxFalse;
}
}

Filed Under: Javascript

  • 1
  • 2
  • Next Page »

Pages

  • About Me
  • WordPress Permalinks in IIS using Custom 404 Redirect

Archives

  • May 2019
  • February 2019
  • January 2018
  • May 2016
  • April 2016
  • December 2015
  • November 2015
  • May 2015
  • April 2015
  • January 2013
  • March 2012
  • February 2012
  • December 2011
  • September 2011
  • August 2011
  • November 2010
  • October 2010
  • June 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • November 2008
  • September 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • December 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • January 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • May 2005

ASP.NET Resources

  • Keven Roth’s Code Library
  • Lemon Law

Blogroll

  • Arin Morfopoulos
  • Jamie
  • Physical Therapists

Code Search Engines

  • Koders
  • Krugle

CSS & Design Resources

  • CSS Basics

Other

  • Amazon
  • Car Repair Questions
  • Cool Quizzes
  • Delphi LA
  • Physical Therapy Clinic Directory
  • Quickbooks Questions
  • Secret Santa Game

Site\'s I\'ve Designed or Helped With

  • Area Rugs
  • Dental Implants
  • Dental Website Design
  • FHA Loans
  • Secret Santa Gift Ideas