Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Newbie struggling with forms

    Hi,
    could some kind expert point me in the right direction with this beginner question.

    At this stage I simply want to click to select a checkbox and then click a button that will open a MsgBox and announce which checkbox I clicked.

    Depending on which checkbox I clicked I get the error;



    Code:
    Line: 55
    Char: 1
    Error: Type mismatch: 'RunScript'
    Code:0
    URL: http://bla bla bla
    Here is my code;

    Code:
    <html>
    <head>
    <title>My Page</title>
    <script type="text/VBScript" language="VBScript">
    Sub RunScript()
    If b80.checked Then
                    Runb80()
    End If
         If b8vpn checked Then
                           Runb8vpn()
         End If
              If bdevo checked Then
                                Runbdevo()
              End If
                   If bdevvpn checked Then
                                       Runbdevvpn()
                   End If
                        If b70 checked Then
                                        Runb70()
                        End If
                             If b7vpn checked Then
                                               Runb7vpn()
                        End If
    End Sub
    Sub Runb80()
      MsgBox("you called Runb80")
    End Sub
        Sub Runb8vpn()
          MsgBox("you called Runb8vpn")
        End Sub
          Sub Rundevo()
            MsgBox("you called Rundevo")
          End Sub
            Sub Runbdevvpn()
              MsgBox("you called Runbdevvpn")
            End Sub
              Sub Runb70()
                MsgBox("you called Runb70")
              End Sub
                Sub Runb7vpn()
                  MsgBox("you called Runb7vpn")
                End Sub
    </Script>
    </head>
    <body>
    <form name="myform" action="">
    <div><br>
    <input type="checkbox" name="b80" value="b80">  b80<br>
    <input type="checkbox" name="b8vpn" value="b8vpn"> b8vpn<br>
    <input type="checkbox" name="bdevo" value="bdevo"> bdevo
    <input type="checkbox" name="bdevvpn" value="bdevvpn"> bdevvpn<br>
    <input type="checkbox" name="b70" value="b70"> b70<br>
    <input type="checkbox" name="b7vpn" value="b7vpn"> b7vpn<br>
    <input type="button" value="Run" name="run_button" onClick="RunScript()">
    </div>
    </form>
    </div>
    </form>
    </body>
    </html>
    Thank you to any kind expert that can spot the flaw for me.

  • #2
    New Coder
    Join Date
    Jan 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    I have spotted a flaw and resolved it but it has brought about another error;

    The code now looks like this.



    Code:
    <html>
    <head>
    <title>My Page</title>
    <script type="text/VBScript" language="VBScript">
    Sub RunScript()
    If b80.checked Then
                    Runb80()
    End If
         If b8vpn.checked Then
                           Runb8vpn()
         End If
              If bdevo.checked Then
                                Runbdevo()
              End If
                   If bdevvpn.checked Then
                                       Runbdevvpn()
                   End If
                        If b70.checked Then
                                        Runb70()
                        End If
                             If b7vpn.checked Then
                                               Runb7vpn()
                        End If
    End Sub
    Sub Runb80()
      MsgBox("you called Runb80")
    End Sub
        Sub Runb8vpn()
          MsgBox("you called Runb8vpn")
        End Sub
          Sub Rundevo()
            MsgBox("you called Rundevo")
          End Sub
            Sub Runbdevvpn()
              MsgBox("you called Runbdevvpn")
            End Sub
              Sub Runb70()
                MsgBox("you called Runb70")
              End Sub
                Sub Runb7vpn()
                  MsgBox("you called Runb7vpn")
                End Sub
    </Script>
    </head>
    <body>
    <form name="myform" action="">
    <div><br>
    <input type="checkbox" name="b80" value="b80">  b80<br>
    <input type="checkbox" name="b8vpn" value="b8vpn"> b8vpn<br>
    <input type="checkbox" name="bdevo" value="bdevo"> bdevo
    <input type="checkbox" name="bdevvpn" value="bdevvpn"> bdevvpn<br>
    <input type="checkbox" name="b70" value="b70"> b70<br>
    <input type="checkbox" name="b7vpn" value="b7vpn"> b7vpn<br>
    <input type="button" value="Run" name="run_button" onClick="RunScript()">
    </div>
    </form>
    </div>
    </form>
    </body>
    </html>
    and the error now looks like this;



    Code:
    Line: 6
    Char: 1
    Error: Object required:'b80'
    Code:0
    URL:http://bla bla bla
    Thank you again for your help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •