2017-05-12 Forms

posted May 12, 2017, 7:13 AM by Samuel Konstantinovich   [ updated May 12, 2017, 7:55 AM ]
Goal: Form Elements


Lab:
Write a webpage that asks the user for a temperature, and allows the user to convert that temperature into Celsius or into Fahrenheit. When you submit the information, it sends the information to a py file which outputs the correct temperature.
06/
 form.html
 result.py

1: Draw a picture of what you want it to look like
2. Create the form, and link it to the py file.
3. Create the py file, and print out the fieldstorage.
4. Change the py file to utilize the data from the fieldstorage. When there is no data, link the user to the form.
5. Before you worry about c to f, or f to c, just choose to either add or subtract 1. This will test if you can choose between two options.
6. After you can choose either +1 or -1, you can modify your program to actually do the calculations!



Form contains at least a text field + submit button + one other input.
The result prints out the correct temperature.


Forms reference:


Comments