0

I want to remove phone validation from this form below, it's not accepting any phone number, the file is smiple_contact.phtml but I am not sure what code to delete. Thanks.

http://www.b2zee.com/b2c/index.php/b2zee-tourism

1
  • Not enough characters to paste the code here, what is another method?
    – Ashraf
    Commented Jul 4, 2016 at 13:48

1 Answer 1

0

Remove validate-must-phone class from Contact Number field.

For list of all available validation classes, check here : http://inchoo.net/magento/out-of-the-box-form-validation-in-magento/

7
  • I deleted it, but when I submit the Form, an error appears.
    – Ashraf
    Commented Jul 4, 2016 at 13:43
  • if you don't want to validate if empty , remove required-entry class also Commented Jul 4, 2016 at 13:53
  • //var phoneno = /^\+[0-9]{6,20}$/; //var phoneno =/^(?([0-9]{3}))?[- ]?([0-9]{3})[- ]?([0-9]{5})$/; var phoneno =/\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*(\d{1,2})$/; var x = document.getElementById("contact"); var x = x.value; Validation.add('validate-must-phone','You failed to enter Phone no!',function(x){ if( x.match(phoneno)) { return true; }else{ return false;
    – Ashraf
    Commented Jul 4, 2016 at 14:03
  • I have the is also at the bottom.
    – Ashraf
    Commented Jul 4, 2016 at 14:03
  • Then remove this element to be validated. Try to remove required-entry class. Can not debug the code you posted Commented Jul 4, 2016 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.