VBScript won't acknowledge new radio buttons RRS feed

  • Question

  • Disregard this. The existing buttons were in a section of the page that was inside a form tag but the new buttons were outside of that section and had no form tag.


    I have an asp.net application which was originally made in VS 2002 or 2003. The app has been built via several newer versions of Visual Studio since. I've been able to make minor edits to it with VS 2017 but adding another set of radio buttons isn't working. The new radio selections appear on the form. They can be clicked and activate their button handler subroutine which runs on the client. VBScript doesn't seem to acknowledge the new radio button objects.

    The original two radio buttons are rdoBTN. The three new buttons are rdoForm. The code below displays a blank popup (no error message) using the original button, rdoBTN. Then using the rdoForm button, it displays a popup with, "object doesn't support this property or method". That is the simplest piece of code I could make fail. Of course, I also can't use anything like 'document.form1.rdoForm("rdoReg").checked' either. Any ideas?

    From VBScript:

    sub rdoForm_OnClick
        On Error Resume Next
        Dim foobar
        'this works
        Set foobar = document.form1.rdoBTN
        oWsh.popup err.Description
        'but this does not (why?): object doesn't support this property or method
        Set foobar = document.form1.rdoForm
        oWsh.popup err.Description
    end sub

    Markup below; The testnet checkbox is work in progress. I only included it because it is in the same tab.

    <td class="auto-style8" valign="middle">&nbsp;&nbsp;&nbsp;&nbsp;
    	New/Rebuild<input class="style4" id="rdoReg" onclick="rdoForm_OnClick" type="radio" value="rdoReg" name="rdoForm"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    	SOCS<input class="style4" id="rdoSOCS" onclick="rdoForm_OnClick" type="radio" value="rdoSOCS" name="rdoForm"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    	BreakFix<input class="style4" id="rdoBreakFix" type="radio" value="rdoBreakFix" name="rdoForm"/>
    <td class="style4" valign="middle">
    	Yes<input class="style4" id="YES" onclick="rdoBTN_OnClick" type="radio" value="YES" name="rdoBTN" disabled="disabled"/>&nbsp;&nbsp;
    	No<input class="style4" id="NO" onclick="rdoBTN_OnClick" type="radio" value="NO" name="rdoBTN" disabled="disabled"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    	Test Net?<input class="style4" id="testnet" onclick="rdoBTN_OnClick" type="checkbox" value="true" name="testnet" disabled="disabled"/>

    • Edited by Fearless96 Thursday, January 24, 2019 1:58 PM
    • Moved by Bill_Stewart Friday, March 15, 2019 6:21 PM Off-topic
    Wednesday, January 23, 2019 2:20 PM

All replies

  • It is impossible to read your HTML.  You need to format it correctly.


    Wednesday, January 23, 2019 3:12 PM
  • It is one input per line now. (I don't make the markup. Visual Studio makes it.) The testnet checkbox is work in progress. I only included it because it is in the same tab.
    Wednesday, January 23, 2019 4:19 PM
  • Where are you trying to run this script?  If in a web page then you need to post in the ASP.Net froum.  This is not an ASP.Net forum It is an administrative scripting forum.


    Wednesday, January 23, 2019 4:45 PM