Saturday, July 28, 2012

Auto Fill same type of inputs js




infoplus

I have changed wintekweb php as wintekweb infoplus to avoid limitations in my blog. Now, I have expanded my blog with java scripts lesions as initial step later I could have ability of blogging many different subjects.  

Java Scripts

JavaScript is also a scripting language of the Web. It adds functionality, validate forms, communicate with the server etc. As the PHP tutorials which, I have posted, these posts are also going with examples. My effort is to meet the interest of users and to solve FAQs I found in java scripts.

Auto Fill same type of input js 


Here, I have created First Name and User Name, Email and Verify Email as same fields

First Name
User Name
Email
Verify Email

Bellow,I have included the scripts with java and html save the file as .html then you need not to have local server to run those file like in php.

<html>
<head>
<script type="text/javascript" charset="utf-8">  
function updateUser(){      
first = document.getElementById("first").value;      
document.getElementById("user").value = first;  
}
function updateEmail(){
email= document.getElementById("email").value;      
document.getElementById("vemail").value = email;
}      
</script>
</head>
<body>
<table bgcolor=#5d76b5>
<tr bgcolor=#e9eff7><td>First Name</td><td><input type="text" name="some_name" value="" id="first" onkeyup="updateUser();"></td></tr>
<tr bgcolor=#e9eff7><td>User Name</td><td><input type="text" name="some_name" value="" id="user" onkeyup="updateUser();"></td></tr>
<tr bgcolor=#e9eff7><td>Email</td><td><input type="text" name="some_name" value="" id="email" onkeyup="updateEmail();"></td></tr>
<tr bgcolor=#e9eff7><td>Varify Email</td><td><input type="text" name="some_name" value="" id="vemail" onkeyup="updateEmail();"></td></tr>
</table>
</body>
</html>

No comments:

Post a Comment