Hello,

I had a working ASP.Net (VB.Net) website which utilized a javascript routine during StartUp.
It would do a document.getElementsByTagName("input"); to find all of the Input objects and then selectively work on their style values as initialization processing.
It all worked fine.

     var elemInputs = document.getElementsByTagName("input");
     for(var i = 0; i < (elemInputs.length-1); i++) 
     {
        var inputField = elemInputs[i].name;
        if(inputField.indexOf('chkLot') == 0) {
        // --- processing code here... ---
        }
     }

Previously worked fine.

Now I have added Ajax to the mix with an UpdatePanel.
That alone made things a 'challenge' because my VB.Net: ScriptManager.RegisterClientScriptBlock() was no longer working to launch the intended code.

But, after much web searching, I finally got the right VB.Net code to launch the intended startup javascript routine.

ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), Guid.NewGuid().ToString(), "startUpScript()", True)

Setting breakpoints in Firebug enable me to confirm that the intended code is being executed.

But now my document.getElementsByTagName("input"); is no longer 'seeing' the various Input objects and therefore does not act upon their style.

When I look at elemInputs within FireBug, I no longer see it containing the variety of Input objects that I need to find.

What is going on?

How can I resolve this so that the Startup javascript 'sees' the form objects?

What is the HTML structure containing those inputs?
And what doc-type are you using?

Did you change any of the above-mentioned before this issue has arisen?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.