Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1465
$find not finding ...
posted

Hello.

I have a WebNumericEdit in a datalist in a Content form.

In the code behind I use the ClientID property of the WNE to write it out to the client script.

So the ID that's written out is ctl00_ContentPlaceHolder1_dlIncludedItems_ctl01_txtIncludedQty

But the actual ID that I need to reference in javascript is igtxtctl00_ContentPlaceHolder1_dlIncludedItems_ctl01_txtIncludedQty. That is, ctl00_ContentPlaceHolder1_dlIncludedItems_ctl01_txtIncludedQty with "igtxt" prepended to it.

I've hardcoded "igtxt" in the code-behind so that I can get at the object (WNE), but I don't like to hardwire anything.

So my question is, in the code-behind, what combination of properties, etc do I use to get the full name, igtxtctl00_ContentPlaceHolder1_dlIncludedItems_ctl01_txtIncludedQty?

Thanks in advance,

Mike

Parents
  • 24497
    posted

    Hi Mark,

    If you need to use getElementById, then you may keep your hard coded value.

    The id of main element of WebTextEdit uses private structure, which has prefix igtxt. For public support for that element you should use member variable Element. For example, if you process any ClientSideEvents (let say, Initialize), then you may

    function webTextEditInitialize(oEditor)
    {
       var elemMain = oEditor.Element;//can be TABLE or INPUT
       var elemInput = oEditor.elem;//can be same as Element
       window.alert('Id of main elem=' + elemMain.id);
    }

Reply Children