[pmwiki-users] Attach form field type (was: More answers to: More Wikiforms)

John Rankin john.rankin at affinity.co.nz
Mon Aug 6 18:10:57 CDT 2007


On Tuesday, 7 August 2007 8:20 AM, Sameer Kumar <skumar at eharch.com> wrote:
>
><snip>
> 
>When you look at the page source (action=source), what
>*exactly* do you get for these fields? You need to be
>getting (for example):
> 
>aaaa\\
>bbbb\\
>cccc
> 
><snip>
> 
>When I look at the source, I am getting something like the following:
> 
></td><td  valign='top'>abc<br />def<br />ghi
> 
>In other words, I am getting a <br /> markup. It seems to be doing fine so far70;
>
It looks promising.

I meant the wiki source (?action=source), rather than the html
source. The html looks correct, but we should check the wiki source
to verify it is correct. I assume you have tried using the form to
edit the page and it correctly takes the data apart for editing?

><snip>
> 
>To link to a project by its title, use this markup:
> 
>[[?title of page]]
> 
>The '?' markup tells it to invoke the title lookup.
> 
><snip>
> 
>This works quite well. Thank you!
>

Great!!  :-D

I wish I could find a robust and simple way to associate a
form with a page of arbitrary name. Every scheme that
has been discussed over the years has so far had too many
drawbacks. One day...
 
>I was trying to add a file upload box to the form. I tried to
>follow the instructions on the various wikiforms pages on the
>pmwiki.org website but could not get it to work. I also tried
>to replace the wikiform.php with the wikiform-attach.php which
>I found on one of the talk pages but all the earlier problems
>with the form (like 56;value=57;) started again. So I reverted back to what I had.
>In essence, for every page created in the form, there should be
>an associated image which I would like the users to include
>while they are filling up the form. Is that easily achievable?
>

I have had an "attach" field type on my to do list for a while.
Maybe it's time to give this task a higher priority...

I think it could work like this:

- in the FormTemplate, define a field like this example:

:Upload file:upload (attach=png|jpg|gif)

- this produces the following form field layout:

Upload file Attach:[.........................] dot ( ) png ( ) jpg ( ) gif

- the author fills in the name of the file and clicks the
   desired extension

- once the form is saved, the author clicks the link to
   invoke the standard upload function

- the list of extensions could be optional; if undefined,
   the author would have to supply it and any extension
   would be allowed; if only one extension type is
   allowed (eg for a pdf library), that could be added
   automatically

I think this would be quite easy to implement.

What do you think?

>Thanks again, John!
> 
> 


-- 
John Rankin
Affinity Limited
T 64 4 495 3737
F 64 4 473 7991
021 RANKIN
john.rankin at affinity.co.nz
www.affinity.co.nz





More information about the pmwiki-users mailing list