通过按Tab复制控件中的值 [英] Copying values in a control by pressing tab

查看:116
本文介绍了通过按Tab复制控件中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想按TAB键将出现在控件(例如textBox,DropdownList)上的值复制到某个文件.
但是,任何人都可以分享如何做到这一点的想法吗?

想象一个Windows窗体,其中(Text Box,DDownList)之类的控件将根据从图像读取的值而出现在Form上.此处的控件会自动添加到窗体中. 现在,当我只按TAB键时,它将复制控件中的值并将其保存到某个文件中.

请等待一个想法!

谢谢,
Sourabh

Hi,

I want to copy values appearing on a control(eg. textBox,DropdownList) on press of TAB key to some file.
But can anyshare any idea how to do that?

imagine a Windows form where controls like (Text Box,DDownList) will come on Form depending upon the values it reads from a image.Here controls are automatically added to the form.
now when i just press on TAB key it will copy the values from the control and save it to some file.

Please awaiting for an Idea!

Thanks,
Sourabh

推荐答案

使用jquery,并在添加动态控件的同时向其添加通用的CSS类.

为该css类在jquery中编写模糊"函数,它将为您提供控件的价值.

使用jquery ajax使用该值调用服务器功能

use jquery and while adding dynamic control add common css class to them.

for that css class write "blur" function in jquery and that will give you value of the control.

with that value call server function using jquery ajax

<input type="textbox" class="copyValue">
<select class="copyValue">
  <option>One</option>
  <option><two></two></option>
</select>





<script>


(文档).ready(funciton(){ bind(); }); </script> global.js 函数 bind() {
(document).ready(funciton(){ bind(); }); </script> global.js function bind() {


(' .copyValue').blur(功能(){ // 读取值 // 调用jquery ajax函数 }); } </ 输入 >
('.copyValue').blur(function() { //readvalue //call jquery ajax function }); }</input>


这篇关于通过按Tab复制控件中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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