加入文本框脚本 [英] Join Text box script

查看:74
本文介绍了加入文本框脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户在单独的文本框中输入2个单独的值,即;
示例box1:12345 box2:15.550,然后用户单击Enter按钮,将出现第三个文本框,其中显示了框1和2的输入值相加,减去框2中输入的第一个和最后一个数字,并减去框2中的点.
第三盒输出示例:12345555

I would like a user to enter 2 separate values in separate text boxes ie;
example box1: 12345 box2: 15.550 user would then click an enter button and a third text box would appear showing the input values from box 1 and 2 joined, minus the first and last numbers inputed in box 2 and minus the dot in box 2.
3rd box output example: 12345555
Is it possible to write in javascript or html?

推荐答案

<html>

<head>
<title>new Numer</title>
</head>

<body>

<p>TextBox1 :<input type="text" id="t1" / size="20">
<p>TextBox2 :<input type="text" id="t2" / size="20">
<script> var t1 = document.getElementById('t1'); t1.onkeyup = t1.onchange = function() { document.getElementById('t2').value = this.value; }; </script> </p>
<strong>R</strong>
<p>TextBox3 :<input type="text" id="t3" / size="20"></p>
</body>
</html>


这篇关于加入文本框脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆