Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form as well?)

Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form as well?)

am 14.07.2005 18:46:01 von Hal

I'm having problems with a object and when I first tried to set a
value, I got error messages, so I changed my code to retreive the object and
print out the possible values and the value names. It did not print out the
values available in the code, so I changed my code to retreive an array of
objects and found that this one tag, the item was then
seen as one object, and I could use it as expected. I need to know if I'm
doing something wrong, or why a object, if this is a bug I need to report, or, if not, how I can
select ONE value in a objects that are the
problem:



When I cleaned it up, it was like this:



This did not make a difference. The only thing that did make a difference was
when I removed "MULTIPLE". I changed my code to set the objects value I used:

$mech->select($name, $val);

And once I realized the problem was with the MULTIPLE keyword, I tried:

$mech->select($name, \@val)

Just in case it needed an array (only the first array element was set).

And here's the code it outputs if the MULTIPLE keyword is left in:

--------------------------------------------------------
Option name: locatoin, Count found: 4
Option:
Value:
Value:
Name: off
Name:
Option:
Value:
Value: 1
Name: off
Name: East End
Option:
Value:
Value: 2
Name: off
Name: West End
Option:
Value:
Value: 3
Name: off
Name: Southside
Option:
Value:
Value: 4
Name: off
Name: Northside


And here's the code it outputs if the MULTIPLE keyword is left out:

--------------------------------------------------------
Option name: location Count found: 0
Option:
Value:
Value: 1
Value: 2
Value: 3
Value: 4
Name:
Name: East End
Name: West End
Name: Southside
Name: Northside

So if the MULTIPLE keyword is in, it sees each
> tags
> were missing), so I got the page, fixed it with a few regexes, then
> replaced
> the HTML, and that didn't fix the problem. After experimenting, I
> found that
> once I removed the MULTIPLE keyword from the is not treated as one
> object. I've included much
> more
> below.
>
> Here's the code for the form object I'm dealing with (the form itself
> is okay,
> it seems to be this and a few other
>

Re: Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form as well?)

am 14.07.2005 23:16:53 von Hal

On Thursday 14 July 2005 05:04 pm, Andy Lester wrote:
> On Thu, Jul 14, 2005 at 05:01:40PM -0400, Hal Vaughan
(hal@thresholddigital.com) wrote:
> > Does anyone have examples of element without the multiple attribute there will be one input
object of type of "option". For a multiple> completely differently from a non-multiple select.

The part I find frustrating is that I won't know how well this works until I
submit the form to the site I'm dealing with, and that means I pay for a
report. Is there some way to find out, before calling $form->submit() what
will be POSTed when the form/page is submitted?

Hal

Re: Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form aswell?)

am 14.07.2005 23:30:56 von gedanken

On Thu, 14 Jul 2005, Hal Vaughan wrote:

The part I find frustrating is that I won't know how well this works until I
submit the form to the site I'm dealing with, and that means I pay for a
report. Is there some way to find out, before calling $form->submit() what
will be POSTed when the form/page is submitted?

isnt there an as_string method on the request object?

mfp

Hal


--
gedanken

Re: Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form as well?)

am 14.07.2005 23:46:20 von Andy

On Thu, Jul 14, 2005 at 05:16:53PM -0400, Hal Vaughan (hal@thresholddigital.com) wrote:
> The part I find frustrating is that I won't know how well this works until I
> submit the form to the site I'm dealing with, and that means I pay for a
> report. Is there some way to find out, before calling $form->submit() what
> will be POSTed when the form/page is submitted?

Sure. Make your own HTTP::Request object. Do the dirty work that Mech
does for you.

xoxo,
Andy

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance

Re: Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form as well?)

am 14.07.2005 23:47:06 von Hal

On Thursday 14 July 2005 05:30 pm, Gedanken wrote:
> On Thu, 14 Jul 2005, Hal Vaughan wrote:
>
> The part I find frustrating is that I won't know how well this works until
> I submit the form to the site I'm dealing with, and that means I pay for a
> report. Is there some way to find out, before calling $form->submit() what
> will be POSTed when the form/page is submitted?
>
> isnt there an as_string method on the request object?

I have to plead ignorance here -- I can't even see how I can get a request
object from Mech before it is sent (or even at all).

Hal

Re: Problem with <SELECT MULTIPLE> in Mech (maybe in HTTP::Form as well?)

am 14.07.2005 23:53:28 von Hal

On Thursday 14 July 2005 05:46 pm, Andy Lester wrote:
> On Thu, Jul 14, 2005 at 05:16:53PM -0400, Hal Vaughan=20
(hal@thresholddigital.com) wrote:
> > The part I find frustrating is that I won't know how well this works
> > until I submit the form to the site I'm dealing with, and that means I
> > pay for a report. Is there some way to find out, before calling
> > $form->submit() what will be POSTed when the form/page is submitted?
>
> Sure. Make your own HTTP::Request object. Do the dirty work that Mech
> does for you.
>
> xoxo,
> Andy

I'd rather not. =A0In this case, since there doesn't seem to be a way to se=
t a=20
through Mech. =A0Please tell me I've missed something in =
what=20
I'm doing with the above methods and that there is an answer that I, in my=
=20
exhausted state, am missing. =A0The first method above works perfectly -- a=
s=20
long as the