perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Davis <sdav...@mail.nih.gov>
Subject Re: [mp2] how to add data to posted form?
Date Sun, 07 Oct 2007 14:18:50 GMT
newgaton new wrote:
>
>
> 2007/10/7, Perrin Harkins <perrin@elem.com <mailto:perrin@elem.com>>:
>
>     On 10/6/07, newgaton new <newjts@gmail.com
>     <mailto:newjts@gmail.com>> wrote:
>     > i have a question. i am coding a program. i must change / add some
>     > data to posted form from browser .
>
>     What are you trying to do? Using the parsed request data as a place
>     to store your own global data is a bad idea. If you just want to
>     store something in a convenient place, use $r->pnotes. If you want to
>     trick some legacy code that you can't change into receiving modified
>     parameters, use an input filter. If you're trying to trick some some
>     code that you can change, just change the code instead to get its
>     parameters from a method you provide.
>
>     - Perrin
>
>
> thanx very much to reply my question, I wanna find a interface to add some
> data to form (or maybe I will make a form in handler) which is posted
> from
> a browser. I am doing some job like the
> Module Apache::ParseFormData . now I don't know how to change or add
> the form
> data.
>
> for instance browser send some form data including some input element,
> now
> I wanna add some input element to it in server side, I know the data
> format is
> another style in server side. now I can't find the interface to add
> data to form.
>

I would read the form data on the server side into perl data structures.
Then, you can simply add to the perl data structures. I know this sounds
like an obvious solution, but that is the way that web applications work.

If you are asking about how to change what is in the form on the
browser, you cannot do that once the form has been submitted without
regenerating the HTML and sending it back to the browser (or doing some
AJAX calls from the browser, which is likely to be more complicated).

Sean

Mime
View raw message