[pmwiki-users] Using Foxedit in a table

Hans design5 at softflow.co.uk
Wed Sep 17 09:44:07 CDT 2008


Wednesday, September 17, 2008, 9:47:03 AM, Graham Archer wrote:

>  That did it - thank you.

well, it did not, and i was quite wrong with my suggestions.

Now i got this example working, try it and change to your needs:

1. Form to post new table rows:

Name list:
(:foxmessage:)
(:table:)
(:cellnr:)'''#'''
(:cell:)'''Surname'''
(:cell:)'''First Name'''
(:cell:)
(:cell:)
(:fox tablefrm redirect=1 put=aboveform template=Test.TableFormTemplate target={*$FullName} ptvtarget={*$FullName} ptvfields=number :)
(:cellnr:)'''New:''' 
(:cell:)(:input text surname :)
(:cell:)(:input text firstname :)
(:cell:)(:input hidden name=$:row '{$$(add {$:row} 1)}':)
(:input submit post "Add" :)
(:foxend tablefrm:)
(:tableend:)
(:row: 0:)


2. Template page Test.TableFormTemplate for the form above:

#foxbegin#
(:cellnr:){$$row}
(:cell:){$:Name{$$row}} (:Name{$$row}:{$$surname}:)
(:cell:){$:FirstName{$$row}} (:FirstName{$$row}:{$$firstname}:)
(:cell:)[-({[foxedit section={$$row} form=Test.RowEditForm]})-]
(:cell:)[-({[foxdelrange]})-]
#foxend#


3. FoxEdit form page Test.RowEditForm:

'''Editing {$EditTarget} row {$EditSection}'''
(:fox editform ptvtarget={$EditTarget} redirect=1:)
(:input default source={$EditSource}:)
Surname: (:input text name=$:Name{$EditSection}:)
First Name: (:input text name=$:FirstName{$EditSection}:)
(:input submit post Save:)
(:foxend editform:)



  ~Hans




More information about the pmwiki-users mailing list