[Solved] How to disable email validation in rails device [closed]

Simply comment out the line specifying validators for the email attribute, or remove it altogether: # app/models/user.rb # validates :email, :presence => false, :email => false You’ll also need to make a slight modification to your users table. By default, Devise does not allow the email field to be null. Create and run change a … Read more

[Solved] Email and mobile number validation on same html5 textbox with button

here is the simple javascript code which will validate both email and phone number. <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script> <script> function ValidateEmail(mail) { var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; // if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value)) if(mail.match(mailformat)) { alert(mail); return (true) } alert(“You have entered an invalid email address!”) return (false) } function validate() { var data=document.getElementById(“email”).value; checkNumberorEmail(); } function phonenumber(inputtxt) { … Read more

[Solved] Validation in a C++ Program [closed]

You can test for input success with an if: if (cin >> ch) … To ask the user to enter input again, you’ll need a loop, and you also need to call cin.clear() to restore the stream’s state: cout << “\n Enter your choice(1,2,3,9)”: cin >> ch; while (!cin) { cout << “Invalid input. Please … Read more

[Solved] How to Regular Expression match not having a constant at the end of a string (.net validator)

(?> … ) is the syntax for an atomic grouping. And the syntax for look-ahead assertion is just (?! … ). Edit   Try this regular expression instead: .*$(?<!-CONST) The .*$ will consume everything and the look-behind assertion will exclude those that end with a -CONST. Edit    Just for completeness’ sake: If your regular expression language does not … Read more

[Solved] How to do validation for text box in JavaScript [closed]

Use the following code in your “keyup blur” event handler $(function() { $(‘input.alpha[$id=tb1]’.bind(‘keyup blur’, function() { if (this.value.search(/^[a-zA-Z]*$/) === -1) { alert(“Only valid characters present”); } }); }); Use + instead of * if you don’t want to allow empty matches for regex. solved How to do validation for text box in JavaScript [closed]