Javascript validation instead of Java action validation
Currently i am validating the validation form for phone number using the following code in Java action, but i want to do this validation from javascript, can you guys please guide me.

    String mvrUserPhone = mvrUser.getPhone();
            mvrUserPhone = mvrUserPhone.replaceAll("[+-]", "");
            if (!mvrUserPhone.isEmpty()) {
                try {
                    long phoneNumber = Long.parseLong(mvrUserPhone);
                    System.out.println(phoneNumber);
                } catch (Exception ex) {
                    errorMessage = errorMessage + "<br />- Invalid phone number.<br /> 
    (Please enter phone number in xxx-xxx-xxxx format)";
                    errorCount++;
                }

--
thanks
Javascript validation instead of Java action validation
===

Currently i am validating the validation form for phone number using the following code in Java action, but i want to do this validation from javascript, can you guys please guide me.

    String mvrUserPhone = mvrUser.getPhone();
            mvrUserPhone = mvrUserPhone.replaceAll("[+-]", "");
            if (!mvrUserPhone.isEmpty()) {
                try {
                    long phoneNumber = Long.parseLong(mvrUserPhone);
                    System.out.println(phoneNumber);
                } catch (Exception ex) {
                    errorMessage = errorMessage + "<br />- Invalid phone number.<br /> 
    (Please enter phone number in xxx-xxx-xxxx format)";
                    errorCount++;
                }

--
thanks