Hi Monks,

I m trying to access a webpage that has two dropdown list and two input boxes. The HTML code is as below-

<script language="JavaScript" src="/cpLoginIE.js"></script> <HTML><HEAD><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQ +UIV="Expires" CONTENT="-1"></HEAD> <BODY onLoad="self.focus();document.loginfrm.site.focus();populateSite +s('Prod','pso1')"> <form method="POST" name="loginfrm" scope="session" onSubmit="return v +alidateForm();" action="/DPSLogOn?webserver=asiwsws2.ms.com&webport=7 +101&appserver="> <CENTER> <TABLE> <TR> <TD><B>Site:</B></TD> <TD><SELECT name="site" class="drpdwn" size=1 width="200" onCh +ange="populateZones(this, 'pso1');"><OPTION value="Production Support +"></OPTION></SELECT> <INPUT type="hidden" name="shortsite" size="3" value="pso"></T +D> </TR> <TR> <TD><B>Zone:</B></TD> <TD><SELECT name="zone" class="drpdwn" size=1 width="100"><OPT +ION value="pso1"></OPTION></SELECT></TD> </TR> <TR> <TD><B>User ID:</B></TD> <TD><INPUT type="text" name="user" size=20 value="dpsasm"></TD +> </TR> <TR> <TD><B>Password:</B></TD> <TD><INPUT type="password" name="password" size=20></TD> </TR> <TR> <TD colspan="2">DPS User IDs will be deactivated after 120 day +s of inactivity. <br>A new user id will need to be requested after an id is dea +ctivated</TD> </TR>

following is the mech code that i m using to browse the website-

$url = "http://asiwsws2.ms.com:7101/DPSLogOn"; $mech->post( $url ); print " Success 1\n" if( $mech->success ); $mech->submit_form ( form_name => 'loginfrm', fields => { site => 'pso', zone => 'pso1', user => 'dpsasm', password => 'XXXXX' }, );

The above code gives the following error when run -

Illegal value 'pso' for field 'zone' at /appl/emas/modules/lib/perl5/site_perl/5.8.5/WWW/Mechanize.pm line 1367

Is there something that i m missing ? Not sure if it could be because of the embedded javascript

Any help would be highy appreciated

Thanks


In reply to Problem in Mechanize by libvenus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.