HTML textbox and VbScript

Author Message
robiee4u

  • Total Posts : 36
  • Scores: 0
  • Reward points : 0
  • Joined: 10/6/2004
  • Location:
  • Status: offline
HTML textbox and VbScript Monday, March 07, 2005 4:34 AM (permalink)
0
I got a script and it is returing my intended result in a msgbox, but when I m tring to assign this value to a textfield (which is declared in the html block) something like this :
textfield.Text = oMatch.Value
an error is occuring that object required. Seems that the script is not getting the textfield as a object. Any idea how i can assign this value to a textfield.
 
#1
    Snipah

    • Total Posts : 1339
    • Scores: 8
    • Reward points : 0
    • Joined: 11/1/2004
    • Location: Scotland
    • Status: offline
    Re: HTML textbox and VbScript Monday, March 07, 2005 4:36 AM (permalink)
    0
    Dit you do a search on VisualBasicScript.com?

    like textbox html and such?
     
    #2
      Snipah

      • Total Posts : 1339
      • Scores: 8
      • Reward points : 0
      • Joined: 11/1/2004
      • Location: Scotland
      • Status: offline
      Re: HTML textbox and VbScript Monday, March 07, 2005 4:38 AM (permalink)
       
      #3
        token

        • Total Posts : 1917
        • Scores: 0
        • Reward points : 0
        • Joined: 1/14/2005
        • Location:
        • Status: offline
        Re: HTML textbox and VbScript Monday, March 07, 2005 6:42 AM (permalink)
        0
        You may want to post some codes here so others get a chance to see what went wrong in your scripts.

         
        #4
          robiee4u

          • Total Posts : 36
          • Scores: 0
          • Reward points : 0
          • Joined: 10/6/2004
          • Location:
          • Status: offline
          Re: HTML textbox and VbScript Monday, March 07, 2005 9:25 PM (permalink)
          0
          <html>
          <head>
          <title>Trouble Shooting Tool for Helpdesk</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          </head><body bgcolor="#FFFFFF">
          <object classid="clsid:{72C24DD5-D70A-438B-8A42-98424B88AFB8}" id="o_shellobj"></object>
          <script language="VBscript">
          Sub IP()
          'Option Explicit
          On Error resume Next
          Dim result, outPut,ip
          'Set o_shellobj = CreateObject("WScript.Shell")
          if(err.number<>0) Then
          msgbox (Err.Description)
          exit sub
          End If
          set result = o_shellobj.Exec("ping uk911dp6008")
          if(err.number<>0) Then
          msgbox (Err.Description)
          exit sub
          End If
          outPut = ""
          Do While result.StdOut.AtEndOfStream <> True
          outPut = outPut + result.StdOut.ReadLine
          Loop
          if(err.number<>0) Then
          msgbox (Err.Description)

          exit sub
          End If
          Dim oRE, oMatches
          Set oRE = New RegExp
          if(err.number<>0) Then
          msgbox (Err.Description)
          exit sub
          End If
          oRE.Global = True
          if(err.number<>0) Then
          msgbox (Err.Description)
          exit sub
          End If
          oRE.IgnoreCase = True
          if(err.number<>0) Then
          msgbox (Err.Description)
          exit sub
          End If
          oRE.Pattern = "[0-9]+.[0-9]+.[0-9]+.[0-9]+"
          if(err.number<>0) Then
          msgbox (Err.Description)
          exit sub
          End If
          set oMatches = oRE.Execute(outPut)
          if(err.number<>0) Then
          msgbox (Err.Description)
          err.clear
          exit sub
          End If
          Dim oMatch
          For Each oMatch In oMatches
          ' textfield.Value = oMatch.Value '<<<<<<<<<<<<<<<<problem:i want this value to asssign to the textfield
          'msgbox (oMatch.Value) ' instead of of the messagebox >>>>>>>>>>>>>>>>>>>>.
          ip = oMatch.Value
          Exit For
          Next
          if(err.number<>0) Then
          msgbox(Err.Description)
          msgbox"here is the prob"
          exit sub
          End If
          End Sub
          </script>
          <div id="Layer1" style="position:absolute; left:207px; top:25px; width:414px; height:20px; z-index:1"></div>
          <div id="Layer2" style="position:absolute; left:157px; top:55px; width:549px; height:70px; z-index:2">
          <form name="form1" >
          <p>Computer Name:
          <input type="text" name="textfield">

          <INPUT TYPE="Button" NAME="Button1" VALUE="Click">
          <SCRIPT FOR="Button1" EVENT="onClick" LANGUAGE="VBScript">
          call IP()
          </SCRIPT>

          IP Address
          <input type="text" name="textfield2" >
          </p>
          </form>
          </div>
          <div id="Layer3" style="position:absolute; left:51px; top:145px; width:873px; height:17px; z-index:3">
          <hr>
          </div>
          <div id="Layer4" style="position:absolute; left:53px; top:188px; width:881px; height:490px; z-index:4"></div>
          </body>
          </html>
           
          #5
            robiee4u

            • Total Posts : 36
            • Scores: 0
            • Reward points : 0
            • Joined: 10/6/2004
            • Location:
            • Status: offline
            Re: HTML textbox and VbScript Monday, March 07, 2005 9:26 PM (permalink)
            0
            what i want from the previous code is to get the match value assigned to the textfield but i dont have idea whether it is possible? plz help.
             
            #6
              Snipah

              • Total Posts : 1339
              • Scores: 8
              • Reward points : 0
              • Joined: 11/1/2004
              • Location: Scotland
              • Status: offline
              Re: HTML textbox and VbScript Tuesday, March 08, 2005 1:47 AM (permalink)
              0
              yes it is possible, convert the page to an HTA (just change the extension)

              I changed this:

              set result = o_shellobj.Exec("ping "& form1.textfield.value)

              form1.textfield2.Value = oMatch.Value

               
              #7

                Online Bookmarks Sharing: Share/Bookmark

                Jump to:

                Current active users

                There are 0 members and 1 guests.

                Icon Legend and Permission

                • New Messages
                • No New Messages
                • Hot Topic w/ New Messages
                • Hot Topic w/o New Messages
                • Locked w/ New Messages
                • Locked w/o New Messages
                • Read Message
                • Post New Thread
                • Reply to message
                • Post New Poll
                • Submit Vote
                • Post reward post
                • Delete my own posts
                • Delete my own threads
                • Rate post

                2000-2012 ASPPlayground.NET Forum Version 3.9