当前位置: 动力学知识库 > 问答 > 编程问答 >

Feedback form validation using Javascript

问题描述:

People, help me, please. I can't do normal script for form validation. I have 4 inputs in my form: "Name", "E-mail", "Theme", "Message". How to realize that if input is empty, the messages about which inputs are empty and which of them (it's about their values) aren't equal to regular expressions?

I have following regular expressions for my inputs:

1: /^[А-Яа-яЁё]+$/ - "Name" - one russian word in lower case or upper case

2: - "E-mail" - say, please, if there is something better than it

3, 4: /^[А-Яа-яЁё\W\s\d]+$/ - "Theme", "Message" - only russian words + all symbols allowed

网友答案:

Google is your friend. Have a read of the first result when you search 'Javascript form validation' – http://www.w3schools.com/js/js_form_validation.asp

分享给朋友:
您可能感兴趣的文章:
随机阅读: