Z
Zdenko
Hi,
I have few texboxes on web page and java script code which manipulates with
content of those text boxes. Everything works fine.
Problem arises when I put web page inside content placeholder of master
page. Depending on content place holder ID of control is changed. It becomes
something like Ctrl000$txtIput.
More interesting thing that same name pattern is not used when dynamic
control is added to page. In page load I am dynamicaly adding few text
boxes.
Name change is understandable, to avoid duplicate IDs.
I have to get ID of content place holder of master page (inside it runs my
web page) and modify JavaScript on the fly:
This works in standalone web page:
var obj = document.getObjectbyID("txtAddress1");
When master page is used code has to be cjanged to:
var obj = document.getObjectbyID("Ctrl000$blabla$txtAddress1");
And if control was dynamicaly created:
var obj = document.getObjectbyID("Ctrl000blablatxtAddress1");
How to get decorated name of the control?
Bigest problem is that I am using separate source files for JavaScript. I
know that I can declare variable in .js file (Ex.var txtName1
and create
JS part of page which will assign dynamicaly name of the control.
Is there any better way?
Zdenko
I have few texboxes on web page and java script code which manipulates with
content of those text boxes. Everything works fine.
Problem arises when I put web page inside content placeholder of master
page. Depending on content place holder ID of control is changed. It becomes
something like Ctrl000$txtIput.
More interesting thing that same name pattern is not used when dynamic
control is added to page. In page load I am dynamicaly adding few text
boxes.
Name change is understandable, to avoid duplicate IDs.
I have to get ID of content place holder of master page (inside it runs my
web page) and modify JavaScript on the fly:
This works in standalone web page:
var obj = document.getObjectbyID("txtAddress1");
When master page is used code has to be cjanged to:
var obj = document.getObjectbyID("Ctrl000$blabla$txtAddress1");
And if control was dynamicaly created:
var obj = document.getObjectbyID("Ctrl000blablatxtAddress1");
How to get decorated name of the control?
Bigest problem is that I am using separate source files for JavaScript. I
know that I can declare variable in .js file (Ex.var txtName1
JS part of page which will assign dynamicaly name of the control.
Is there any better way?
Zdenko