CallBack Manager - Masterpage

G

Guest

Hello

i make my first steps with the Callback Manager
for example

function Script_CalculateValues(result,context)
{
alert("test : \n" + result);
//document.forms[0].elements["txtHG"].value = "2test";
//document.all.txtHG.Value = "2test";
//document.getElementById("txtHG").value = "fjkds";
//document.all.ContentPlaceHolder1.Label2.Text = "test";
}

When i use a Masterpage, i cannot access the textbox.
the contentplaceholder includes the textbox
all variants in the upper example were unsuccessful

ANY IDEA
 
B

Brock Allen

You shouldn't hard-code this ID into your js code. Instead dynamically emit
the js with the Control.ClientID property -- this is the ID that the control
will have in the browser.


Solution

document.getElementByID('ctl00_ContentPlaceHolder1_txtHG').value

Sabine

Sabine said:
Hello

i make my first steps with the Callback Manager
for example
function Script_CalculateValues(result,context)
{
alert("test : \n" + result);
//document.forms[0].elements["txtHG"].value = "2test";
//document.all.txtHG.Value = "2test";
//document.getElementById("txtHG").value = "fjkds";
//document.all.ContentPlaceHolder1.Label2.Text = "test";
}
When i use a Masterpage, i cannot access the textbox.
the contentplaceholder includes the textbox
all variants in the upper example were unsuccessful
ANY IDEA

-- THANKS

Sabine
 

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top