Piet van Zanten
How to use returntocapture after validating a form November 12, 2011 01:02PM |
Piet van Zanten
Re: How to use returntocapture after validating a form September 23, 2012 04:24PM |
sError,sControl is stringThe server procedure is called in the form validation button click code (server)
x is string x=Check_Input(edt_Roepnaam..Name+RC+edt_Voorl..Name+RC+edt_Naam..Name+RC+edt_GebDat..Name+TAB+"date"+RC+edt_Email..Name+TAB+"email") IF x<>"" THEN sError=ExtractString(x,1) sControl=ExtractString(x,2) RETURN //code continued, validation o.k. ENDThe server procedure:
PROCEDURE Check_Input(sFieldList) x,sError,sControl,sStart is string FOR EACH STRING sField OF sFieldList SEPARATED BY CR x=ExtractString(sField,1) sStart="The field '"+{x,indControl}..Caption+"' " SWITCH ExtractString(sField,2) CASE "email" IF NOT CheckEmail({x,indControl}) THEN sError=sStart+"does not contain a valid email addres" END CASE "date" IF NOT DateValid({x,indControl}) THEN sError=sStart+"does not contain a valid date." END CASE "bank" //this is a typical Dutch check for bank account numbers IF NOT Elfproef_OK(0,{x,indControl},True,9) THEN sError=sStart+"voldoet niet aan de 11-proef." END OTHER CASE IF {x,indControl}="" THEN sError=sStart+" is required." END END IF sError<>"" THEN sControl={x,indControl}..Alias //By using the alias we can use the sControlname in browser code BREAK END END IF sError="" THEN RESULT "" ELSE RESULT sError+TAB+sControl END
IF sError<>"" THEN Info(sError) ReturnToCapture(sControl) ENDTo do:
Re: How to use returntocapture after validating a form November 14, 2018 01:24PM |
Registered: 4 years ago Posts: 1 |
Renko vd molen
Re: How to use returntocapture after validating a form July 07, 2021 10:59AM |