how to get object from Javascript?

  • Thread starter Bruno Alexandre
  • Start date
B

Bruno Alexandre

Hi guys...

How can we get the object value from Javascipt...

if I try:

document.getElementById('myTextbox').value
for
<asp:textbox runat="server" id="myTextbox" text="blablabla" />

it works if I do no tuse MP.


using MP and inside a Wizard Control, I need to get, for example:
document.getElementById('ctl00_ContentPlaceHolderMain_wzLan_cliIsDanish_0').checked

for the first LisItem of a RadioButton... is there a way to do this
correctly?
 
G

Guest

Bruno,
Here is a short example of one way to perform what I call "ClientID
Unmangling":


private string script = "[Label1ID].innerHTML = 'boo!';";
private string scriptKey = "hello";
private bool addScriptTags = true;
protected void Page_Load(object sender, EventArgs e)
{
script = script.Replace("[Label1ID]",Label1.ClientID);
ClientScript.RegisterStartupScript(this.GetType(), scriptKey, script,
addScriptTags);
 

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
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top