Computer Learning Zone CLZ Access Excel Word Windows

Study without desire spoils the memory, and it retains nothing that it takes in.

-Leonardo da Vinci
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Tips & Tricks

New Tips Added Weekly!
Click here to get on our Mailing List

   
 
HTA

Beginner - Level 2

Adding controls to the page

At the moment the page doesn't do much. It's a static page with just a few words on it. We can add some controls to add more functionality.

Say we want to add some input to retrieve data from the user, we can use some Input controls.

Start off with a Form.

	<form action="" method="">
	</form>
	

We can then start adding controls.

I like to add Labels for each control to aid in Accessibility. This helps for tabbing and if you click on a label it will select that control.

Username:
	<label for="UserName">UserName:</label>
	<input type="text" value="Alex" size="30" id="UserName" name="UserName">
	

Password:
	<label for="Password">Password</label>
	<input type="password" id="Password" name="Password">
	

Some other useful controls:

Hidden

Just by changing the TYPE attribute you can hide a value.

	<label for="CustomerID">CustomerID</label>
	<input type="hidden" id="CustomerID" name="CustomerID">
	

You may wish to remove the Label as if it's hidden you wouldn't want it showing.


Checkbox
	<label for="MailingList">Mailing List</label>
	<input type="checkbox" id="MailingList" name="MailingList">	
	

File
	<label for="CV">CV</label>
	<input type="file" id="CV" name="CV">
	

An INPUT might not be big enough, you can use a Textarea in it's place.

Textarea
	<label for="info">Info: </label>
	<textarea rows="5" cols="30" name="info" id="info">Lots of information.</textarea>
	

You may be familar with the COMBOBOX in Access, in HTML this is a SELECT control.

Select
	<label for="courses">Courses</label>
	<select id="courses" name="courses">
		<option value="AB1">Access Beginner 1</option>
		<option value="AB2">Access Beginner 2</option>
		<option value="EB1">Excel Beginner 1</option>
		<option value="EB2">Excel Beginner 2</option>
	</select>
	

You can sub divide these using an OPTGROUP or Option Group.

	<label for="courses">Courses</label>
	<select id="courses" name="courses">
		<optgroup label="Access">
			<option value="AB1">Access Beginner 1</option>
			<option value="AB2">Access Beginner 2</option>
		</optgroup>
		<optgroup label="Excel">
			<option value="EB1">Excel Beginner 1</option>
			<option value="EB2">Excel Beginner 2</option>
		</optgroup>
	</select>
	

Radio buttons

I like to surround similar controls in a group using a Fieldset. By adding a Legend you can better label this.

	<fieldset>
		<legend>Gender</legend>
		<label for="Male">Male</label>
		<input type="radio" name="radio" id="Male" value="Male">
		<br />
		<label for="Female">Female</label>
		<input type="radio" name="radio" id="Female" value="Female">
	</fieldset>
	
Gender

Submit Button
	<input type="submit" value="Submit">
	

Reset Button
	<input type="reset" value="Reset">
	

Input Button
	<label for="TestButton">TestButton</label>
	<input type="button" id="TestButton" name="TestButton" value="Test Button">
	

Button
	<label for="TestButton">TestButton</label>
	<button type="button" onclick="alert('Hello world!')" 
		id="TestButton" name="TestButton">Click Me!</button>
	

You can add these all into a HTA.

Controls (HTA)


Sample Files
Controls.hta


Previous Lesson: Beginner Level 1 | Next Lesson: Beginner Level 3

 

Alex Hedley (Avatar) By: Alex Hedley


Click here to sign up for more FREE tips

 

 

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2023 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/8/2023 2:07:43 AM.