Click here to Skip to main content
12,688,944 members (30,598 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET

I have two textboxes named box1 and box2 respt... box1 has a particular value say 100. I need to get that value to be displayed on box2 when I single click (mouse) on the box1.

I tried for text_changed event on box1 but it is not possible as we should enter some value in box1 and enter click.. But what i need is without writing anything in the box1, I need to get the data displayed from box1 to box2 on enter click or mouse click of box1.
Posted 27-Nov-12 1:24am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you can do that in textbox onblur event .
function in javascript
function copy(Box 1,Box2)

// var box1= document.getElementById(Box1).value;
// var box2 = document.getElementById(Box2).value;
// box2.value=box1;
var box1= document.getElementById(Box1);
var box2 = document.getElementById(Box2);


in .cs page
under pageload() you can add attribute as

this event will fire every time focus comes out of textbox 'box1'

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170113.4 | Last Updated 27 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100