Tagged: javascript

How to validate email id in javascript 0

How to validate email id in javascript

Find the below code by which you can validate the email field using java-script on client side, var reg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; if(!reg.test(document.getElementById(“email”).value)){ alert(“Please fill email address in correct format”); document.getElementById(’email’).focus(); return false; }

Change iframe url using javascript 0

Change iframe url using javascript

If you want to change the iframe url from the iframe window, you can use this small function to change the url of the iframe. <script type=”text/javascript”> $(document).ready(function() { $(‘#clickToClose’).click( function() { window.parent.frames[“myframe”].location.href=’frame.php’; return...

How to upload multiple files at a time 0

How to upload multiple files at a time

To upload a file first of all you have to set the formĀ  “enctype” Like the given blow example. <form id=”form1″ name=”form1″ method=”post” action=”” enctype=”multipart/form-data”> By this Javascript user can create multiple upload box...