![]() | Exercise 2.13. Testing for unchecked radio button |
|
The following script tests for the value of a radio-button. What will happen when the button is not checked?
#! /local/bin/python
import cgi
query = cgi.parse()
print "Content-type: text/html"
print
print "<html>\n"
print "<body>\n"
if query.has_key('radio1'):
print "<p> radio1 checked</p>\n"
print "</body>\n"
print "</html>\n"
You can try this script here: test_checked.html
| |
![]() | Exercise 2.15. Testing for improper user input (continued) |
|
Does the setting of this input form help? Why not? | |