2014年4月28日 星期一

Lab 19 Lab Form and Action

Purpose of lab: Learn how to use Form to invoke a remote service through CGI.
1. Take a look at the search box of this search page, inlcuding radio buttons, text input, and submit button.
2. Open your Notepad++.
3. Open a new empty HTML file.
4. Write a form that acts like this search page.
5. In the form you write, set Action="http://google.com/search" and name of Form as "f" and method as "get" (See Hint if it does not work.)
6. Save your file on your computer.
7. Run your HTML by Chrome/Firefox. What do you get?
8. Set method as "post"
9. Run your HTML by Chrome/Firefox. What do you get? You can watch the Forms and Input in the Web Development Course at Udacity.

==============================

Search by Google:

程式碼:
<html>
<body>
<form name="f" action="http://google.com/search" method="get">
Search by Google: <input type="text" name="q" value="">
<input type="submit" value="Search">
</form>
</body>
</html>

沒有留言:

張貼留言