in reply to WWW:Mechanize::FormFiller documentation

What are you trying to do, and what happened when you tried it? If you are just trying to fill out a web-based form, WWW::Mechanize can do that without the FormFiller module. If you really are trying to use callbacks to fill the form, then give us a hint what you are having trouble with.


We're not surrounded, we're in a target-rich environment!
  • Comment on Re: WWW:Mechanize::FormFiller documentation

Replies are listed 'Best First'.
Re: WWW:Mechanize::FormFiller documentation
by Feral_Shade (Novice) on Apr 16, 2003 at 03:37 UTC
    Ok, here's what I need to do:
    I am writing these perl scripts for a database I'm developing
    which has a series of forms associated with
    entering new data into the database. When the user submits
    a query to the database he/she will have the option
    to edit any of the returned records. If the user chooses to
    edit a record I need the script to present the user with the same
    form he/she used to enter the data except that all of the
    fields will be filled in with the corresponding values from the database.
    Entering and retrieving the information from the database is not a problem,
    but I just need some way to populate the forms and present them back to the user.
    What is the easiest module to use in order to do this?
    Thanks again to everyone who has helped me thus far.
      You'll have to generate the HTML for the page and set the value of each form field using the value attribute for the tag. Escaping the data would also be a good idea, and maybe some kind of check to make sure the user didn't enter anything they shouldn't have.

      I usually use HTML::Template to create my, um, HTML templates. The escapeHTML method in CGI should be good enough for escaping data. There might be some module that can do all of this for you, but I don't know about it off hand...

        Ok, so all I have to do is take my originial forms and
        add something like value="<TMPL_VAR NAME=FIELD_VALUE>" to
        each input tag and then use the param() function to set each
        value. Wow, that really is a lot easier than trying
        to figure out how to use WWW::Mechanize::FormFiller. Thanks.
        I'll try not to clog up the forms with any more questions tonight :)