[pmwiki-users] How to prepend text to the value entered in a form's text box

Eemeli Aro eemeli at gmail.com
Tue Jun 2 04:46:27 CDT 2009

2009/6/2 Randy Brown <randy at brownragfilms.com>:
> How do I prepend text to the Summary when the user submits a form? I already
> know how to set a default value, and how to get a user-entered value, but
> not how to mix the two.
> For example, If the user enters "I changed X" I want to prepend "Modified
> {*$FullName} - " and have the summary end up as "Modified MyPage - I changed
> X"

Is it the entry in the page history (action=diff) that you want to
change, or the entry on RecentChanges pages? If the first, you'll need
to prepend a function to the $EditFunctions array (looped through when
a page is saved) that'll change the contents of the new page's "csum"
and "csum:$Now" fields to whatever you want. If the latter, you should
define your own $RecentChangesFmt array.

Alternatively, you could do the replacement using Javascript when the
edit form is submitted.


More information about the pmwiki-users mailing list