Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted
Comments
Karthik. A 21-Jun-12 22:17pm    
Is your question about web forms or windows forms? You have tagged your question with jquery, javascript etc, but you also talk about windows forms. If it's a web form, you can use the .change() event to achieve what you want.

1 solution

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

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


JavaScript
<script>
   $(document).ready(funciton(){
        bind();
   });
</script>


global.js
function bind()
{
    $('.copyValue').blur(function() {
         //readvalue
         //call jquery ajax function
    });
}</input>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900