Question

Have a "check"?

For example... I would have a dictionary with the parameters to sent to the POST.

params = {'text':'how are you?', 'subject':'hi'}

then I would have

opener.open('theurl',urllib.urlencode(params))

The question is...those parameters work well with text-boxes, since I just put the value in there. How about radio buttons? How do I signify which is "checked"?

Was it helpful?

Solution

Radio buttons has values too

<input type="radio" name="music" value="Rock" checked="checked"> Rock<br>
<input type="radio" name="music" value="Pop"> Pop<br>
<input type="radio" name="music" value="Metal"> Metal<br>

for that case {"music":"Rock"} in params

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top