Web Analytics Made Easy -
StatCounter vbscript and html forms..pain in the @$$ - CodingForum

Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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:


    If you'd like to learn a little Javascript, check out:
    Take your web pages to the next level with interactive JavaScript elements. Find tutorials, how-tos, sample scripts, and more to help you learn to write your own JavaScript code.


    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.

    Comment


    • #3
      Thanks, I'll be sure to ask if i have any more questions.

      Comment

      Working...
      X