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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry vbscript and html forms..pain in the @$$

    I have a few questions here:

    1) in the form, does the name of the button have to have the ()'s or only when its in the vb script?

    2) do i need the <form> tags? with the <input> tags can i just get rid of them and use the input tags instead?

    3) and i dont understand how to make the vb code look at the html values that the user inputs and this is making me real frustrated, so if anyone can please help me, that would be great.



    <html>
    <!-- user inputs a value,and the box returns the same value that the user inputs -->

    <head>

    <script language="vbs">

    sub bvalue_onclick()


    end sub

    </script>



    </head>

    <body bgcolor="fafad2">

    <!-- form -->
    <form name="value">
    Input any value: <input type="text" name="ivalue">
    <input type="button" name="bvalue" value="click me">
    </form>

    <!-- end of form -->

    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Personally, I would use Javascript over VBScript because it makes more sense, and browsers other than Internet Explorer support it. (VBScript is a Microsoft product, thus only Internet Explorer supports it).

    But if you really want to know how to make your code work:
    Code:
    <html> 
    <!-- user inputs a value,and the box returns the same value that the user inputs -->
    
    <head>
    
    <script language="vbs">
    
    sub bvalue_onclick()
     msgbox theForm.theInput.value
    end sub
    
    </script>
    
    
    
    </head>
    
    <body bgcolor="fafad2">
    
    <!-- form -->
    <form name="theForm">
    Input any value: <input type="text" name="theInput">
    <input type="button" name="bvalue" value="click me">
    </form>
    
    <!-- end of form -->
    
    </body>
    </html>
    For more form stuff with VBScript, check out:
    http://authors.aspalliance.com/glenncook/vbscript.asp

    If you'd like to learn a little Javascript, check out:
    http://javascript.about.com/library/...rmvalidate.htm

    You do need the <form> tag if you want to be able to submit the inputs on your form somewhere, such as to an ASP, PHP, JSP, Servlet, CGI, or something else to do some logic stuff, or even to send the inputs to an email address.

    If you're not going to do anything with your inputs outside of this page, then no, you don't need the form tags. But it still doesn't hurt to have them in.

    Hope that clears some stuff up. Post back if you're having more troubles,
    Sadiq.

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, I'll be sure to ask if i have any more questions.


  •  

    Posting Permissions

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