Josh Bryan

December 29, 2005

BrainJar.com: Validation Algorithms

Filed under: Coding,Software — jbryan @ 3:15 pm

I found this useful bit of code today for an ABA check validation algorithm. After realizing that aba routing numbers don’t use the same LUHN10 check that creditcards do, I searched and found that it is a similar but different algorithm. Hope somebody finds it useful.

December 9, 2005

Javascript form error…

Filed under: Coding — jbryan @ 5:24 pm

I was recently working on a project where I had written some javascript code to manipulate and submit a form.  It called the standard javascript form.onsubmit() function.  It worked just fine on my test pages but when I paired it with the code the html designer had created.  

Suddently, I kept getting this error: "form.submit is not a function".  Now, I’ve been coding long enough to know that every form has a submit function.  So, what could have gone wrong?  It took me a while but I soon realized that the html designer had named the submit button ‘submit’.  This overwrote the submit function and made submit an element instead. 

The moral of the story: Never name form elements (or really any element for that matter) a javascript keyword, its just asking for trouble.

« Previous Page