[pmwiki-users] Input recipe

Joachim Durchholz jo at durchholz.org
Sat Jun 25 12:16:41 CDT 2005


Christian Schlatter wrote:
> Joachim Durchholz wrote:
> 
>> Christian Schlatter wrote:
>>
>>> I'd be very interested in having a wiki syntax for HTML forms. But we 
>>> should not intermix form syntax with script functionality. So we 
>>> should just have an easy to use syntax which can be used to build all 
>>> of the HTML form elements (I know this is a difficult task).
>>
>> Not really - it's been done :-)
> 
> hmm, your proposed solution is one way to go (IMHO a good one). On the 
> other hand, the difference to standard HTML form syntax isn't that big. 
> So should I learn now yet another form syntax, or should we really look 
> for a wiki-style form syntax (e.g. [x]).

It will be "learning another syntax", even if it's just wiki-style form 
syntax. There's a whole lot of things that can and should be set for 
each form control, so I don't think a "simple syntax" will cut it.

I'll get an alpha release of the code ready this weekend I think, so 
everybody can kick it around a little and see how well that syntax works.
If people consider the syntax *still* unwieldy at that point, I'll 
readily support finding a better one - but I think right now I'll stick 
with the more regular (:input <verb> <name> <options>:) syntax and get 
it done.

> It would be nice to outline a simple example incuding form syntax and
> action handler (without $_SESSION) in Cookbook.Input.

Ah, I see.
Here goes:

Say you have fairly minimal form with just a single-line text input 
field, like this:
   (:input start:)
   (:input line my_input_text:)
   (:input end:)
then if the user enters "blah", the browser will send that as
   my_input_text=blah
PHP will process the data and place it in $_POST, so your script will 
find the data in $_POST['my_input_text'], which will be 'blah'.

Anything beyond this is just bells and whistles :-)

(Volunteers who place that example in Cookbook.Input would be greatly 
appreciated.)

Regards,
Jo



More information about the pmwiki-users mailing list