Rate these examples

3.5 stars Rating 6.7/10 from 3 votes


Input validation examples for Fox forms

Example 1

(:foxmessages frm list=nocheck:)
(:fox frm foxaction=display :)
(:foxtemplate "*{$$var1}\n*{$$var2}\n*{$$var3}":)
(:input default request=1:)
(:foxcheck var1 msg="Please enter your name!":)
Name: (:input text var1:) %red%(:foxmessage frm var1:)\\
(:foxcheck var2 regex='^[0-9\-]+$' msg="Please enter your phone number!":)
Telefon: (:input text var2:) %red%(:foxmessage frm var2:)\\
(:foxcheck match='56' var3 msg="Wrong answer! Please try again!":)
7 * 8 = (:input text var3:) %red%(:foxmessage frm var3:)\\
(:input submit post Enter:)
(:foxend frm:)

(:foxdisplay:)

Name:
Telefon:

7 * 8 =

Example 2

%red%(:foxmessage form1 ptvupdate=1 list=nocheck:)
(:fox form1 template=Site.FoxTemplates#example :)
(:foxcheck target match='Test*' msg="pagename needs to begin with: Test":)
(:foxcheck date regex='[12]\d\d\d-(0\d|1[0-2])-([0-2]\d|3[01])' msg='please
enter date as YYYY-MM-DD':) 
(:foxcheck time regex='([0-1]\d|2[0-3]):[0-5]\d' msg='enter time as HH:MM
using 24 hour format':)  
(:foxcheck author msg='please sign as author!':) 
Page: (:input text target:) %red%(:foxmessage form1 target:)%%\\
Date: (:input text date:) %red%(:foxmessage form1 date:)%%\\
Time: (:input text time:) %red%(:foxmessage form1 time:)%%\\
Author: (:input text author:) %red%(:foxmessage form1 author:)%%\\
(:input submit post Enter:)
(:foxend form1:)

Page:
Date:
Time:
Author:

<< | TestPages | >>

Layout (Gemini)

Rightbar

Quotation

‘Now’ is the operative word. Everything you put in your way is just a method of putting off the hour when you could actually be doing your dream. You don’t need endless time and perfect conditions. Do it now. Do it today. Do it for twenty minutes and watch your heart start beating. Barbara Sher

 \\#contact:)