0

hi everyone i have 2 textboxes: when i enter a name on first textbox the first letter of what i have entered will appear on second textbox...is it possible for javascript?

to make it clear:
i will enter a name "COCOMARTIN" on the firstbox and the first letter " C " will appear on second textbox..

can someone help me on this ... :)

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by uselessninja
0

Hopes this may help you

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function name_dis()
{
var str=document.f.t1.value;
var lett=str.charAt(0);
document.f.t2.value=lett;
 
}
</script>
</head>

<body>
<form id="form1" name="f" method="post" action="">
  <label>
  <input type="text" name="t1" id="t1" onkeyup="name_dis()"/>
  </label>
  <p>
    <label>
    <input type="text" name="t2" id="t2" />
    </label>
  </p>
</form>
</body>
</html>
0

thankzz for the info dude ^^ ur the best....

Edited by uselessninja: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.