[tpm] Yet Another WWW::Mechanize Question (YAWMQ)

Madison Kelly linux at alteeve.com
Thu Sep 11 18:40:10 PDT 2008


Zoffix Znet wrote:
> Are you sure it's a _space_ there for the value?
> 
> What about this:
> 
> 	$agent->tick("selrow0", $agent->value("selrow0") );

Thank you kindly for your reply.

On my way home, I was looking at the web page source more and realized 
that the site is doing something that seems to me to be truly 
boneheaded. I also think this is where my trouble is coming from...

What it looks like they're doing is using JS to set the checkbox value 
to it's name instead of it's HTML-set value, and this is throwing off 
WWW::Mechanize.

I tried working around this by copying the 'tick' method and changing it 
up to set the value manually, but it throws an error:

-=-=-=-=-
Illegal value 'selrow0' for field 'selrow0' at ./check_avail.lib line 285
-=-=-=-=-

Here is the JS:

-=-=-=-=-
function clicksel( itm )
{
	if (itm.checked)
	{
		if ((document._LocationSelection.sel.value != itm.name ) && ( 
document._LocationSelection.sel.value != ""))
		{
			box = eval("document._LocationSelection." + 
document._LocationSelection.sel.value);
			box.checked = false;
		}
		else
		{
			document._LocationSelection.sel.value = itm.name;
		}
	}
	else if (document._LocationSelection.sel.value == itm.name)
	{
		document._LocationSelection.sel.value = "";
	}
}
-=-=-=-=-

So I am further along, but still just as stumped. :(

Madi


More information about the toronto-pm mailing list