hi, i am trying to run a simple html page with a java script validation for range validation
i have two text fields in which user enters two alphanumeric values i have to validate if the first value is less than second or not. when i click on submit i am getting "document.id.value" is null or not an object
thanks i have changed to use the form name and field names...
but the values of ids i have is alphanumeric, so i have to compare for the string part of it and then the integer part of it.
like if i have from "bc1" to "cd4" then i have to first compare if b<c which is true and also if they are "bc1" and "bc2" then also its true as here 1<2 but if they are like "bc1" and "ac2" then it is false as b>a ... hope i am clear?
Looks like you need to write your own comparison routine to validate this since this is a pretty unique case. what is the logic for the following cases 12BAR & BAR12 or AB124 & ABC12 & what if they have strings of varying lengths ??
First u need to validate if they are valid alpha-numeric characters ( a simple search wud give you free examples) & then get one character from each & continue your check using
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop