Results 1 to 6 of 6

Thread: VBScript to get textbox values

  1. #1
    Join Date
    Nov 2009
    Posts
    68

    VBScript to get textbox values

    I have just began to learn the scripting language- VBScript. I am also side by side learning Visual Basic 6.0 as it is in my academic requirements. Our group have been assigned a small assignment to develop a website using VBScript. And I have to access the values which are present in the text boxes. How can I proceed to script this in VBScript. Please explain.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    document.getElementByID

    I am not that much aware of VB-script but I do know that the document.getElementByID works with JavaScript for all web browsers. But this too has a limitation that it works only on the client-side. So in case you want it for client side you may try the document.getElementByID.

  3. #3
    Join Date
    Nov 2009
    Posts
    68

    Server Side and Client Side scripting

    I have to deal with the server side code as well as the client side code because I am needed to give the textbox value to a function which is on the server side as a parameter. I know we can use the Request.Form function, but I do not want to a postback. So kindly please help me sort this out.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Validating text box

    Code:
    <HTML>
    <HEAD><TITLE>TextBox Checking</TITLE>
    <SCRIPT LANGUAGE="VBScript"> 
    <!--
    Sub Submit_OnClick
      Dim form
      Set form = Document.ValidForm
      If IsNumeric(form.txtb1.Value) Then
        If form.txtb1.Value < 11 Or form.txtb1.Value > 20 Then
          MsgBox "Please input from a range of 11 - 20"
        End If
      Else
        MsgBox "Only Numbers."
      End If
    End Sub
    -->
    </SCRIPT>
    </HEAD>
    <BODY>
    <H3>Verifications</H3><HR>
    <FORM NAME="fform">
    Give a number from 11 to 20: 
    <INPUT NAME="txtb1" TYPE="TEXT" SIZE="2">
    <INPUT NAME="Submit" TYPE="BUTTON" VALUE="Submit">
    </FORM>
    </BODY>
    </HTML>
    I used this program to validate the entries in my textbox. I have used VBscript as the Scripting language. I guess you can work on this code to modify it accordingly.

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Application Form

    I have written the application form for accepting the user's first name and last name and then providing the user with his/her full name. This I had to use in my website which I had to built for an assignment which was given to me.
    Code:
    <B>Application</B>
    <form name="App">
      <table border="0" width="300">
        <tr>
          <td width="80">Initial Name:</td>
          <td width="194"><input type="text" name="txtfname" size="14"
    		       onChange="form.txtfull.value = form.txtfname.value + ' ' +
    						form.txtlname.value"></td>
        </tr>
        <tr>
          <td width="80">Surname:</td>
          <td width="194"><input type="text" name="txtlname" size="14"
                           onChange="form.txtfull.value = form.txtfname.value + ' ' +
    					form.txtLastName.value"></td>
        </tr>
        <tr>
          <td width="100">Full Name:</td>
          <td width="200"><input type="text" name="txtfull" size="25"></td>
        </tr>
      </table>
    </form>

  6. #6
    Join Date
    May 2008
    Posts
    2,297

    USe Ajax

    I would suggest you to use Ajax to deal with any server side scripting using JScript instead of Vb Script. This is because doing so you will be able to add values in your post from the form values. As you are using JScript, the ASP page will be able to locate that information in Request.Form but the page will not be refreshed.

Similar Threads

  1. W32 registry values are not getting matched by the default values
    By Angrzej in forum Networking & Security
    Replies: 5
    Last Post: 19-05-2011, 12:23 PM
  2. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  3. Moving from one TextBox to another with TAB
    By GeforceUser in forum Software Development
    Replies: 3
    Last Post: 05-11-2009, 06:31 PM
  4. Numeric TextBox in VB.NET
    By Gauresh in forum Software Development
    Replies: 0
    Last Post: 22-12-2008, 05:18 PM
  5. How to use Textbox values for calculations
    By Sonic in forum Software Development
    Replies: 4
    Last Post: 26-11-2008, 08:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,525,017.48133 seconds with 17 queries