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
- Free host forum is not reliable
- Formatting my post
- Powerful js library datable to export table in pdf, excel, sorting, freezing column and table header fixed (sticky)
- job interview questions (1)
- Set up a child account and set screen time limit in Windows 8
- WinMerge - file and folder differencing and merging tool for Windows
- PHP: add a download as pdf file button in report page
- phpexcel toggle expand and hide column in EXCEL and summary
- PHP connect IBM db2 database in XAMPP
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