My collection of things.

jKafer on the Net

Javascript Project: Interactive Quoting Tool

Task: Online quoting tool to be used to configure customized Widgets, assign a Smart Part Number to the configuration, display the full configuration and add up and display quoted price.

Web Hosting Options

My 3 favorite hosting options (in no specific order):

  • pair.com – I have hosted with pair.com for 15+ years and I have never had an outage or interruption of the service. They used to be more for the hands on web master that doesn’t need or want a graphical interface to do things. They have recently introduced a new Control Panel that will walk you through any and every thing you want to do. I highly recommend them.

  • justhost.com – I have hosted with justhost.com for the past 5 years or so. They offer unlimited hosting of domain names. They have a great control panel that offers you all the options you need or want. Lots of space for websites and email. I highly recommend them.

  • godaddy.com – I have worked with many sites that are using godaddy.com hosting services, some options they are are better than others. Recently they started offering WordPress as an option. The only “con” I have for them is that some of their web site building applications have a slow response when you are creating. But they do offer so many deals it’s hard to not like these guys.

Find the Index number of an item in a Javascript Array

I recently was creating a quoting form for a company that I was working for and I wanted to streamline as much as possible (i love to combine things or as I say, get more for my money!). When the quote was completed it would return a description of the items ordered and assign a Smart Part Number to the configuration.

  • So I have a list of categories – with options, setup as radio buttons.
  • When a selection is made I want to load that item (description, price, partNo) into the display area.
  • And build and display the Smart Part number.

TASK: The order in which the items are displayed and added to the display area is very important, so I coded the radio buttons with an ID – then I lookup that ID in an array and get the index number (order number) of that item and that is the placement in the smart part number.

Here is the javascript code I used to do that:

<SCRIPT language = "JavaScript">

//define array outside of a function to make it universally available
var arrPNC = [ "00", "A", "B", "C", "D", "E", "F", "G", "H"];
var itemOrder = 0;

//function to do the lookup and return index(order) must pass a letter
function findItem(tComp){
    findVal=tComp.value  //gets the value from the radio button
	//alert(findVal);  //if you want to see what is being searched for
    for(n=0;n<9;n++){
        //alert(arrPNC[n]); // if you want to see what is checked
        if(arrPNC[n]==findVal)
         {//if matches break from loop and get the index
            itemOrder = n;
        }
    }
     if (itemOrder > 0 ){       
       alert(findVal+ " is in position " + itemOrder + " in the array");
     } else {
       alert(findVal + " was not found in the array. Please try again.");
     }
     itemOrder = 0;
}
</script>

Example of the radio button input tag:
<input id="F" onclick="findItem(this);" type="radio" name="B" value="F" />F

Try it select an item below:

C   D   E   F   G   H   I


  • Count per Day

    • 59Visitors today:
    • 74Visitors per day:
    • 0Visitors currently online:
  • ScrapBook Software - MyMemoriesSuite
  • Latest Pins on Pinterest

    • Chevron rustic wall art

    • Project Run and Play: Butterfly Skirt Applique... neat idea for doing a multi-colored applique

    • The quilt is gorgeous! Dallas made by Initial K Studio. http://www.initialkstudio.com/

    • picture only

    • West Virginia star block

    • Southwest inspired Quilt Pattern

    • d i r t y f l a w s | t u m b l r : Photo

    • southwestern quilt More

    • Half Square Triangles - so many possibilities - Chasing Cottons: Quilt Class 101

    • 1