in reply to Re^2: Unable to check checkbox via LWP::UserAgent
in thread Unable to check checkbox via LWP::UserAgent
"Your suggestion looks like the last one of mine above, but with 'off' instead of 'on'. Are you suggesting that setting it to 'off' will check the checkbox?"
Precisely.
Given the following form:
<form action="foo.cgi" method="post"> <input name="foo" value="off" type="checkbox"> </form>
Then when the checkbox is ticked, the string foo=off will be posted to the server. When the checkbox is blank, then the empty string is posted to the server. The string "off" doesn't have any significance to the HTML form. If doesn't mean false, or unticked, or anything. It's just a three-character string that will be posted to the server as the value for the "foo" input when that input has been ticked.
"I'm guessing that this problem may be caused by the '%' in the element name"
That may well be the cause. Normally when a form input name contained an "@" I'd expect the HTML itself to contain a plain "@" (or perhaps HTML-escaped as @ or @). The escaping as '%40' would happen when the form was submitted and encoded as application/x-www-form-urlencoded. There might be some double-encoding happening at some stage.
I suggest taking a look with Wireshark or similar to compare what data LWP::UserAgent is posting compared to what a desktop browser posts.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Unable to check checkbox via LWP::UserAgent
by tel2 (Pilgrim) on Aug 19, 2012 at 21:54 UTC |