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

    • 11Visitors today:
    • 33Visitors per day:
    • 1Visitors currently online:
  • lostmy.name

    Lostmy.name personalize Name books for kids So this was a facebook ad and I thought I would check it out. I was so impressed with the website, the story layouts and the amazing options that are available I just had to order one of these books. Well, I actually ordered both of their books. These are not your average "personalized" name books. I can't wait to get the ones I ordered, I might just keep them for myself. use my link and get 15% off your first book: href="http://www.lostmy.name/friends/jeanette-kafer

  • Latest Pins on Pinterest

    • @suppose_quilts I totally OMG'd outloud when I saw this quilt! I love it! By @suppose_quilts "It just snowed here but we're pretending it's spring. Pattern: Amsterdam, free at cloud9fabrics.com. Fabric: Pam Kitty Garden" via @PhotoRepost_app

    • Striking Strip Quilts: 16 Amazing Patterns for 2 1/2"-Strip Lovers: Kate Henderson: Jelly roll tulip quilt. Flower quilt pattern. affiliate link.

    • Fall Table Runner | from Marta with love http://frommartawithlove.com/fall-table-runner/

    • Scrappy Butterfly Baby Quilt Tutorial | Let your imagination take flight with this baby quilt!

    • All In A Row Again!

    • Feathered stars are fun to quilt! #freemotionquilting #longarmquilting #quiltedthistle

    • Westalee - Curly Q's

    • 18 Easy tutorials for making your own fabric labels at home. Click through to browse the list! DIY Crush

    • 6a0120a5f3f908970b015437f40faf970c-pi 3,312×4,416 pixels