Those issues aren't that hard to solve!
- Validation of numbers (for example, it will allow "text" as a valid height measurement)
js code:
var sFoo = "85.1";
var nFoo = 1 * sFoo; //Attempt a string to number conversion
if( isNaN(nFoo) ) nFoo = 0; //Failed, set to some default value or ignore the declaration
- Validation of matching IDs (for example, two controls with the name "EdtTest")
js code:
var sTestId = "BtnTest"; //Control ID to test
var bIsUniqueId = true; //Boolean to hold the result
for( var i in WndLstId ) { //Loop through the control IDs
if( WndLstId[i] == sTestId ) { //Check if this control ID matches the test ID
//We have a match!
bIsUniqueId = false; //Set the result to false
break; //End the loop (we know it's not unique now)
}
}
//Now make use of bIsUniqueId for further processing