> I'm trying to create a new fraction pattern for validation using Massimo's > TMT Validator but it does not validate correctly. > > tmt_globalPatterns.fraction = new RegExp("^\d* \d*\/{1}\d*$|^\d*$"); > > It's supposed to accept numbers and/or fractions. > Please advise.
Whenever you use the new RegExp() syntax in JavaScript you need to escape the backslashes by doubling them. See also the patterns that ship with the Validator Hope it will help ---------------------------- Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233505 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54