[thelist] javascript1.2 v mac regexp problem

alex alex at deltatraffic.co.uk
Sat Apr 16 09:53:39 CDT 2005

hi evolt

i have a JS problem.

<script language="JavaScript1.2" src="javascript/validateinput.js">

var forename = document.FrmRegister.forename.value;
    var surname = document.FrmRegister.surname.value;
    var year = document.FrmRegister.year.value;
    var regexpress = new RegExp(/^[a-z]+$/i); 
    var testname=regexpress.test(forename);
     var testname2=regexpress.test(surname);
    var regNumbers= new RegExp(/^[0-9]+$/); 
    var yeartest=regNumbers.test(year);

so when i test for a value in testname/ testname2 or yeartest,

ie if(!testname2)

 I receive a negative even though input has been delivered, on a mac - 
either IE or safari.

Presumably these browsers dont ship with JavaScript1.2 - so how would I 
code for the mac in the above case?


More information about the thelist mailing list