Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Express Validation Help 2

Status
Not open for further replies.

angiem

MIS
Sep 29, 2000
116
0
0
CA
I need to do a validation on a text box for the range from
A to F plus characters ()-*/+

This is what I have tried
Code:
function ValidFormula(obj){
var Formula = /^[a-fA-F][\-\(\)\*\/\+]$/
 if (Formula.test(obj)) {
  alert("VALID Formula");
 } else {
  alert("INVALID Formula");
 }
}

Thanks in advance.
 
I only want the users to enter A-F and ()-*/+ characters in a text box for example A-B or (A+B)-C.
 
If "obj" is meant literally by the input element (the "text box"), then test its value.
>if (Formula.test(obj)) {
[tt]if (Formula.test(obj[red].value[/red])) {[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top