Re: [Phplib-users] tpl_form -- how to erase frozen values?
Brought to you by:
nhruby,
richardarcher
From: Herouth M. <he...@it...> - 2002-01-27 10:08:52
|
On 2002 January 25 ,Friday 01:03, you wrote: > Okay, I've been moving right along converting my site to use > tpl_form and I'm slowly become less and less convinced that it was > a good idea. Well, I'm working with tpl_form, and I did need to make a couple of changes and wrappers, but it is really a good tool once you have it set up properly. The main issue is setting up defaults when you use it for update rather than new records. This issue is related to your problem. > I have a form that submits to itself. Sometimes I want to erase > the value that the user entered before the form gets redisplayed. You can do one of two things: 1. Change the value of the global variable before you display the form. Maybe you even need to do that before you create the form. Certainly before get_values(). The form gets the values to display the second time around from whatever you submitted. However, it doesn't use HTTP_POST_VARS (or _POST), but the simple global variables. So changing the variable's value should do the trick. 2. Change the value of the variable in the ooh_forms element. This method is "unsupported" in that you are not supposed to know how ooh_forms actually work. However, I use it for the "update" situation. It is a good method even after you have used get_values. Say your form is $f, and the field name is 'email' then $f->form_data->elements['email']['ob']->value = ''; HTH, Herouth |