in reply to Unexpected behaviour in HTML::FillInForm

I don't think it does what you think it does...

There is a small bug in your program. You do not capture the results of the ->fill call, hence the form is not being filled as you think. What you are seeing is probably the browser remembering what values you had filled in on a previous view of the page. If you check the page source I will bet that the form fields do not have value= attributes.

- Cees

  • Comment on Re: Unexpected behaviour in HTML::FillInForm

Replies are listed 'Best First'.
Re: Re: Unexpected behaviour in HTML::FillInForm
by jdtoronto (Prior) on Dec 21, 2003 at 18:46 UTC
    Cees,

    Your are indeed correct! I was working away late at night and suddenly it seemed to work. But in fact it is an artifact of Mozilla's default form fill-in, as far as I can tell. When I checked it again on Konqueror and IE, and even Mozilla Firebird, it behaved as I thought it would - i.e. no filled in fields.

    I now have it parsing the form templater first, then filling it in, then dragging that into the final page and outputting it.

    Do you know if it is possible to force the browser not to remember the previous view?

    jdtoronto

      Do you know if it is possible to force the browser not to remember the previous view?

      This is speculation, and I don't know if it will work for all browsers, but if you explicitly add the 'value' attribute to each of your form elements then the browser should not use it's own values to prefill the form. If you want the form element to be blank then add value="" (obviously it will vary for other input types like select and textarea but the idea is the same).

      But this is all browser dependant, and hence out of control of the developer. Most browsers will allow you to disable the form filling features, but it is up to the end user to enable/disable the feature.

      - Cees