Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title>mano facebook</title>
- <script language="JavaScript">
- function nuskaitymas()
- {
- a=document.getElementById('email')
- k=a.value
- //document.write(k)
- alert(k);
- }
- function emailValidation(elem, helperMsg) {
- var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
- if(elem.value.match(emailExp)){
- return true;
- }
- else{
- alert(helperMsg);
- elem.focus();
- return false;
- }
- }
- </script>
- </head>
- <body>
- <form>
- <input type="text" id="email">
- <input type="button"
- onclick= "emailValidation(document.getElementById('email'), 'Not valid email')"
- value='Check Field' />
- <input type="text" id='asmens_kodas'>
- <input type="button"
- onclick= "emailValidation(document.getElementById('email'), 'Not valid email')"
- value='Check Field' />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment