Lorna70
asked on
Using popup window from control in DetailsView - problems assigning value to control
Hi I'm calling a javascript Datepicker function from a TextBox control in DetailsView and after selecting a date I have to assign the date value to my TextBox control. My controls are named as follows:
Form with ID="form1"
Details view with ID="dvRoute"
TextBox with ID="txtRouteDate"
My code is:
var ctl = "dvRoute_txtRouteDate";
window.opener.document.for m1[ctl].va lue = dateValue;
This is not working - is there another way to do this or is my syntax wrong?
Form with ID="form1"
Details view with ID="dvRoute"
TextBox with ID="txtRouteDate"
My code is:
var ctl = "dvRoute_txtRouteDate";
window.opener.document.for
This is not working - is there another way to do this or is my syntax wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK - my text box is "dvRoute$txtRouteDate" in the source but it still doesn't work. Should I add the form name to the ctl var before I run:
var ctl = "dvRoute$txtRouteDate"
window.opener.document.get ElementByI d(ctl).val ue = dateValue;
??
var ctl = "dvRoute$txtRouteDate"
window.opener.document.get
??
ASKER
It worked!
For anyone else struggling with this - I went back to using:
var ctl = "dvRoute$txtRouteDate"
window.opener.document.for m1[ctl].va lue = dateValue;
For anyone else struggling with this - I went back to using:
var ctl = "dvRoute$txtRouteDate"
window.opener.document.for
ASKER
Microsoft JScript runtime error: 'window.opener.document.ge
I think my problem is not knowing how to reference a TextBox which is inside a DetailsView which is inside a Form. I tried:
ctl = "form1_dvRoute_txtRouteDat
What is the correct syntax for doing this? Should I be using [] instead of _??