accessing user controls in javascript

B

balu

i created a user control for contact information. this control has
contact name country etc and also phone number. all these are text
boxes. My problem is for phone number i should give 3 text boxes.
where textbox1 is for area code,textbox2 is for exch and textbox3 is
for last four digits in phone number.
My requirement is when user enter 3 numbers in textbox1 the focus
should automatically go to textbox2.
Problem...
Since the above is usercontrol and it should be contained in another
page i'm not able to write in javascript as
x=document.getElementById['textbox1'];y=document.getElementById['textbox2'];if(x.value.length)>3
then y.focus() in key press event.
Could any one please tell me how to access the textbox which is in the
usercontrol.
say usercontrol id is WEBUSERCONTROL1 and text box in the usercontrol
is TEXTBOX1 and the container form is webform1.aspx.
 
M

microchip

you could use parent/child referencing and put it on the parent page
hosting the user controls. Unless i'm not grasping the concept.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,786
Latest member
EmilioGuru

Latest Threads

Top