Saturday, 30 May 2020

VBScript : How to add controls on to the HTA form and How to change a textbox value in vbscript

To add a label box and text box in to the HTA form:

<body>
    <h1>Heading</h1>
<form action="" method="">
    <p> This is a label box and text box section </p>
      <label for="UserName">UserName:</label>
     <input type="text" value="Alex" size="30" id="UserName" name="UserName">
</form>
</body>



To add a button control /submit button

<label for="ClickButton">Click on this button</label> <input type="button" id="ClickButton" name="ClickButton" value="Click Button">



How to change a textbox value in a vbscript in HTA applications:

<script language="VBScript">
          Document.getelementbyID("Textbox").innertext  = "New value of text box"
</script>

This script will update/change the textbox value to new value feeded


To add a combo box in to the HTA form:

<label for="Lblappname">Application Name</label>
<!--select value="---Select App value---">---Select App name---</option-->
<select id="testcombobox" name="testcombobox">
<option value="---Select Application name---">---Select Application name---</option>
 <script Language="VBScript">
  'FindApplicationName()
</script>

</select>


No comments:

Post a Comment

VBScript: How to use Dictionary in VBScript | VBScript objects

=>To declare and create object of a vbscript dictionary: Dim objDictionary Set objDictionary = CreateObject("Scripting.Dictionar...