Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



VBScript to get textbox values

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 17-12-2009
Member
 
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.

Reply With Quote
  #2  
Old 17-12-2009
Member
 
Join Date: May 2008
Posts: 2,381
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.
Reply With Quote
  #3  
Old 17-12-2009
Member
 
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.
Reply With Quote
  #4  
Old 17-12-2009
Member
 
Join Date: Apr 2008
Posts: 1,946
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.
Reply With Quote
  #5  
Old 17-12-2009
Member
 
Join Date: Jan 2008
Posts: 1,514
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>
Reply With Quote
  #6  
Old 17-12-2009
Member
 
Join Date: May 2008
Posts: 2,290
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VBScript to get textbox values"
Thread Thread Starter Forum Replies Last Post
W32 registry values are not getting matched by the default values Angrzej Networking & Security 5 19-05-2011 12:23 PM
Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox Neil Ives Software Development 2 20-08-2010 01:23 AM
Moving from one TextBox to another with TAB GeforceUser Software Development 3 05-11-2009 05:31 PM
Numeric TextBox in VB.NET Gauresh Software Development 0 22-12-2008 04:18 PM
How to use Textbox values for calculations Sonic Software Development 4 26-11-2008 07:17 PM


All times are GMT +5.5. The time now is 07:23 PM.