Jump to content
  • 0

Параллейны ввод в 2 формы


SiNn3R
 Share

Question

7 answers to this question

Recommended Posts

  • 0

Зачем Вам это?

Набросал примерчик:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>textreplace</title>
<script type="text/javascript">
textreplace = function(q, e) {
var reg = /T/;
document.getElementById("form").value += q.substr(q.length-1).replace(reg, "R");
}
</script>
</head>

<body>
<form action="#">
<p>
<input onkeyup="textreplace(this.value, event);" type="text" />
<input id="form" type="text" />
</p>
</form>
</body>
</html>

Это скорее идея, поскольку нужно ещ? исключать обработку shift, alt и прочих клавиш.

Link to comment
Share on other sites

  • 0

Спасибо большое, но мне надо ещ? кое-что. Как сделать чтоб при нажатии на определ?нную букву выводилась другая? Допустим я нажимаю на w - выводиться e, я нажимаю на s - выводиться d и т.д.

Вот что у меня получилось, но загвоздка в том, что значения плюсуются.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>textreplace</title>
<script type="text/javascript">
function textreplace(q, e) {
if (q.value="w"){
document.getElementById("form").value += q.substr(q.length-1).replace(/w/, "e");}
if (q.value="s"){
document.getElementById("form").value += q.substr(q.length-1).replace(/s/, "d");}
return;
}
</script>
</head>

<body>
<form action="#">
<p>
<input onkeyup="textreplace(this.value, event);" type="text" />
<input id="form" type="text" />
</p>
</form>
</body>
</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy