I create a membership website on website that required registration to see full website. I also want users register from specific country. To archive this goal, I also add SMS verification on my registration page and restrict phone number field only for country that I want i.e. 923. If Phone number is not start with 923 phone field's boarder goes red and an alert box apear. But this is only alert and "mental hit", registation form still can be submit. Vague people can use create fake account by using fake number (like recive sms online) Now I want that if phone field not start with 923, the Register button blocked and become unclickable other wise stay normal. How It possible?
Sorry for poor English. I hope you under stand what I want to do.Here is my Registration page. You can see phone number check script in footer. Thanks
Thank you AHarrisGsy for help. I want to validate by 'onClick' function and need help how it possible in js. Actually I want to do same thing as onChange function of <input type="tel"> for "Register" button but with onClick function. When every thing is fine registration go straight but when phone field is incorrect phone form does not submit. Please help I am new to programming. I create this fuctions on JS Fiddle check and modify please. Thanks
Updated the JS Fiddle to work - I changed the Submit Button to a Button so it doesn't submit automatically when pressed and added an onclick() event so that when clicked, it validates the text and calles .submit() if necessary.