Need some validation help

Hi guys.
I have a textfield.
The textfield is set only to allow numbers and dot.
I need to validate to check that what has been input meets the requirements of the data does not start with a 0 like 0123.99 or .0123.99 or 123.99.99
I was thinking use a function


function validate(toVal){
 //Do the validation here
 }

THen the button code to trigger it.


nBut.onRelease = function() {
 return validate(tx1);
 if (validate) {
  validate = false;
  return validate(tx2);
 }
 if (validate) {
  return validate(tx3);
  //Move onto next form if all fields validate
 }
};

I know this but is wrong. Any help on this would be very much appreciatted
thanks
Paul