Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- How to blend adsense inside your post?
- Formatting my post
- Notepad++ - Add C++ compiler
- Install PHPMailer 5.2.4 and use smtp gmail
- Set up a child account and set screen time limit in Windows 8
- Wayback Machine - see archived versions of web pages across time
- phpexcel toggle expand and hide column in EXCEL and summary
- Install PHP ibm_db2 extension in Linux (redHat)
- PHP: add a download as pdf file button in report page
Thursday, December 20, 2012
Introduction to HTML form
I am making a series of videos for web development, which are in my youtube channel.
Introduction to use form, radio, checkbox, select, option text, password, textarea, hidden, file, submit, reset in HTML form.
Example of HTML form:
<html>
<head>
<title>HTML form</title>
</head>
<body>
<h1>HTML form</h1>
<form id="form1" name="form1" method="post" action="test.php">
<p>
User Name: <input type="text" name="name" size="20" /> <br>
Password: <input type="password" name="psd" size="20"><br>
<br>
<input type="submit" name="Submit" value="submit" />
<input type="reset" name="Submit2" value="reset" />
</p>
</form>
</body>
</html>
radio type: used checked to mark default, you can only make one choice
Gender<input type="radio" name="gender" value="male" checked> male
<input type="radio" name="gender" value="female">female
checkbox: : used checked to mark default, you can only make multiple choice
Hobby<input type="checkbox" name="ah1" value="swim"> swim
<input type="checkbox" name="ah2" value="hiking">hiking
<input type="checkbox" name="ah3" value="basketball">basketball
<input type="checkbox" name="ah4" value="hockey" checked>hockey
select from list: used selected as default
Country<select name="jg">
<option value="Canada" >Canada</option>
<option value="USA">USA</option>
<option value="China">China</option>
<option value="Korea">Korea</option>
<option value="Japan" selected >Japan</option>
</select>
textarea: for long text
<textarea name="bz" cols="30" rows="3" ></textarea>
hidden: will not shown, but the value will be assigned to the name when the form is submitted
<input type="hidden" name="x" value="20" >
file: upload a file, a file will be selected from your computer:
Upload<input type="file" name="upload" />
The video for this demo
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment