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 7 of 7

Thread: VbScript

  1. #1
    New Coder
    Join Date
    Nov 2002
    Location
    philippines
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VbScript

    i see VbScript in .html and i see VbScript in .vbs are vbs file can be use in html.

    can you please give me an exampol of vbscript in html use in form events.

    thanks

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Code:
    <html>
    <head>
    <title>vbscript test</title>
    
    </head>
    
    <body>
    
    <script language="VBScript" type="text/vbscript">
    Sub clickme ()
    msgbox "You've pressed the button!"
    End Sub
    
    </script>
    
    
    <input type="button" value="Click Me" onclick="clickme()" />
    </body>
    </html>
    Is this what you wanted? You also can use it to validate form elements too. But you may want to consider using JavaScript for that because VBScript can be wonky sometimes in non-IE browsers.
    OracleGuy

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I thought VBScript worked ONLY in IE browsers?

    I only use VBScript in conjunction with .ASP server-side (because of this limitation), or for doing other nifty things locally (such as changing the format of a comma separated, double quote delimited text file into a pipe-delimited text file for certain software capabilities, or something similar but more complex to export data stored in a database to clients in the format they prefer).

    For anything used on the client-side I definitely stick to javascript.
    Last edited by whammy; 12-09-2002 at 01:46 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    New Coder
    Join Date
    Nov 2002
    Location
    philippines
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reply

    ok thanks

    so javascprit is more use than other script. is this vbScript
    code:--------------------------------------------------------------------------------
    <html>
    <head>
    <title>vbscript test</title>

    </head>

    <body>

    <script language="VBScript" type="text/vbscript">
    Sub clickme ()
    msgbox "You've pressed the button!"
    End Sub

    </script>


    <input type="button" value="Click Me" onclick="clickme()" />
    </body>
    </html>

    can be use in geocities website, do msgbox will run too.

    are .asp file is like a webfile like .html, can you please give me an exampol of .asp


    thanks

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First of all, yes, that's VBScript. It won't work in anything but an Internet Explorer (i.e. Microsoft) browser however, since it's a proprietary Microsoft language.

    It's a bit much to give an example of .asp without you knowing the difference between client-side and server-side scripting, and I don't want to confuse you further.

    Have you tried out your geocities webpage in another browser, Like Mozilla, Netscape, Opera, etc.? As soon as you do, you'll see why you don't want to use VBScript for anything client-side.

    You're best off learning javascript for client-side form validation first... Once you get the hang of that, then you might want to look into server-side scripting (not necessarily ASP/VBScript, many solutions can accomplish the same things).

    If I were you, I'd go here first:

    http://hotwired.lycos.com/webmonkey/...tutorial1.html
    Last edited by whammy; 12-09-2002 at 03:17 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #6
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    I hope this doesn't confuse you but that onClick attribute isn't needed at all.

    Code:
    <script language="vbScript" type="text/vbscript">
    sub Button1_onClick
    msgBox "You clicked button 1"
    end sub
    Sub Button2_onClick
    msgBox "You clicked button 2"
    end sub
    </script>
    <form>
    <input type="button" name="button1" value="One" />
    <br />
    <input type="button" name="button2" value="Two" />
    </form>

    Nifty little things you can do in vbscript that you can't do in js include the ability to change the icon and title on the popup message!

    Code:
    msgBox "This is the message", 16, "This is the title!"
    That should give you a critical warning sign on the message box.
    But in my opinion you should stay away from vbscript unless it is an intranet where you know that all the browsers will be ie because it just isn't worth it if you have javascript to use.
    Omnis mico antequam dominus Spookster!

  • #7
    New Coder
    Join Date
    Nov 2002
    Location
    philippines
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reply

    what application program will you recommend to me for creating .html that use Java Script, for function event use.

    I create webpage on microsoft word. but javascript cannot be use it wont run.

    do JavaScript can able to do Database web.


  •  

    Posting Permissions

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