[pmwiki-users] PmForms and Saving Select Values

DaveG pmwiki at solidgone.com
Wed Dec 31 12:32:18 CST 2008


I'm replying to this in the hopes that it helps someone who does the 
same daft thing I did...

The problem here was nothing to do with select lists. In fact no 
variables were being written on a re-save.

The initial save worked. Changing values in the base page (outside of 
the form) worked: the values were read in by the form. Trying to change 
values inside the form did not work -- they were not rewritten to the 
target page.

Turns out I had done two things wrong:
1] I hadn't included a (:messages:) directive on the form used to show 
existing data -- the redirect form.
2] I was saving data to another page -- one specified by the value in a 
form field. One of the field validation routines checked to see if the 
savedata page already exists, and throws an error if a page does exist. 
This is good for initial entry. However, subsequent saves will try to 
save data to a page that already exist, and so throw an error... which I 
didn't see because of [1].

Solution:
1] Add an (:message:) directive to the redirect form.
2] Change the validation routine. If the saveto page is the same as the 
current page, then do not throw an error.

  ~ ~ Dave


DaveG wrote:
> Does anyone happen to know if PmForms supports setting variable values 
> with select lists?
> 
> It seems to show the list fine. But when saving it saves only the 
> default value. Changing the underlying data values in the saved-data 
> page (the saveto), and then reopening in the form shows the correct 
> value in the list.
> 
> But trying to save a new value chosen from the list doesn't work -- the 
> existing value stays the same, or if not already saved it uses the default.
> 
> I tried removing the default setting, but no change in behavior:
>     (:input default $:status "value1":)
> 
> Anyone successfully used a select with PmForms?
> 
>   ~ ~ Dave
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
> 



More information about the pmwiki-users mailing list