[pmwiki-users] [fox] only add new page when textarea is not empty

Martin Kerz mkerz at me.com
Mon Mar 8 13:00:23 CST 2010

>> What I mean is that I want to (fox)check if a textarea is empty
>> (which I can do right now). If something is entered in the textarea I want to perform a foxadd.
> And what should happen if the textarea input is empty on submission?

No new page should be created or existing pages modified. Here's my example form (I know you've already seen it ;-))

---- 8< ----
(:title Neuen Antrag hinzufügen:)
(:fox neuerantrag redirect=Antraege.{$$SK}-{$$Nummer}_{$$name} pagecheck=1:)
(:foxadd template=JV.VorlageAntrag target=Antraege.{$$SK}-{$$Nummer}_{$$name}:)
(:foxadd template=JV.VorlageBegruendung target=Begruendung.{$$SK}-{$$Nummer}_{$$name}:)
(:foxadd template=JV.VorlageKommentar target=Kommentar.{$$SK}-{$$Nummer}_{$$name}:)
||'''Antragstitel:''' ||(:input text name "Änderung der Satzung" size=20:) ||
||'''Antragsstellerin:''' ||(:input text antragsstellerin "Karla Kolumna" size=20:) ||
||'''Kurzzusammenfassung:''' ||(:input textarea antrag rows=4 cols=10:) ||
||'''Sachkomission:''' ||(:input select SK S:) (:input select SK F:) (:input select SK M:) (:input select SK P:) ||
||'''Antragsnummer:''' ||(:input text Nummer "1" size=2:)||
||'''Noch im Entwurf?:''' ||(:input default IstAntrag 1:)(:input select name="IstAntrag" value=1 label="Fertiger Antrag":)(:input select name="IstAntrag" value=0 label="Entwurf (noch nicht auf der Startseite anzeigen)":)||
(:input textarea antrag rows=20 cols=50:)

(:input textarea begruendung rows=20 cols=50:)

(:input textarea kommentar rows=20 cols=50:)

(:input submit post "Antrag hinzufügen":)
(:foxend neuerantrag:)

---- 8< ----

Thanks a lot.


p.s. Have you seen my call for help from this afternoon. Somehow foxedit which I call through ?action=foxedit, using a specific section doesn't save my page, but simply redirects to the unmodified original page. foxmessages doesn't give any output at all. :-( Again: Do you know how to debug this? FoxConfig is *.*: all :-/

More information about the pmwiki-users mailing list