Hi! I'm using WWW::Mechanize to capture some data.

Please have a look at the html form below (I'm only showing the relevant parts);

I'm trying to get the data from the form with this:

 $mech->submit_form(
    fields => {
       txtRateSheetID => "20000",
       txtAction => "VIEW",
       txtLevelTypeID => "1",
       txtCategoryTypeID => "9",
       txtRateSheetTypeID => "1"
    });

But I'm failing to get the page I need; I guess it's because I haven't
set the action property (action=strPage , according to the
Javascript).

The question is: how do I define the action to be performed?

Thanks in advance for your comments.

Regards,
Toshiro.

----------------------------------------------------------------------------------------------------------

      function SubmitPageWithData(strPage, RateSheetID, ActionVal,
LevelTypeID, CategoryTypeID, RateSheetTypeID)
      {
              //alert(RateSheetID);
              //alert(ActionVal);
              var form = window.document.frmMenu;

              form.txtRateSheetID.value = RateSheetID;
              form.txtRateSheetTypeID.value = RateSheetTypeID;
              form.txtAction.value = ActionVal;
              form.txtLevelTypeID.value = LevelTypeID;
              form.txtCategoryTypeID.value = CategoryTypeID;

              form.target = "_self";form.action=strPage;

              form.method="post";
              form.submit();
      }

<FORM name="frmMenu" id="frmMenu">
<INPUT id=txtRateSheetID name=txtRateSheetID type=hidden value="">
<INPUT id=txtRateSheetTypeID name=txtRateSheetTypeID type=hidden value="">
<INPUT id=txtAction name=txtAction type=hidden value="">
<INPUT id=txtLevelTypeID name=txtLevelTypeID type=hidden value="">
<INPUT id=txtCategoryTypeID name=txtCategoryTypeID type=hidden value="">

<A href="javascript:SubmitPageWithData('View/BrokerRSRequest.asp',
'20000', 'VIEW', 1, 9, 1)">View</A> |

Reply via email to