2022.2

Table Of Contents
l
multipart/form-data:Nocharactersareencoded.Thisvalueisrequiredwhenyou
areusingformsthathaveafileuploadcontrol.
l
text/plain:Spacesareconvertedto"+"symbols,butnospecialcharactersare
encoded.
Changing a Form's validation method
InConnectPlanetPressConnect,therearetwowaysinwhichaForm'sinputcanbevalidated:
l
TheBrowservalidationmethodleavesituptothebrowsertovalidatetheuserinput.When
addingfieldstotheForm(seethenextstep)youcanonlymakefieldsrequiredandsetthemax-
imumlengthasanadditionalrequirementforsomefields.
l
JQuery ValidationvalidatesinputusingJQueryscripts.Thisallowsforstricterrequirementsper
fieldandadifferentmessageforeachfieldtodisplaytotheuseriftheinputisnotvalid.This
methodensuresamoreconsistentvalidation,asitisbrowserindependent.Thenecessary
JQueryfileswillbeaddedtotheJavaScriptfolderontheResourcespanewhenthisoptionis
chosen.
TochangeaForm'svalidationmethod:
1. Right-clickontheFormelementandchooseValidation settings.
2. Chooseavalidationtype(seeabove).
3. Double-clickeachfieldinthelisttoedittheirvalidationsettings:
l
Required:Checkifthefieldisrequiredtosubmittheform.Ifafieldisrequiredbutcontains
nodata,amessagewillbeshowntotheuser.
l
Minimum length:Enteranumericalvaluefortheminimumcharacterlengthrequiredfor
thisfield.
l
Maximum length:Enteranumericalvaluefortheminimumcharacterlengthacceptedfor
thisfield.
l
Equal to:Usethedrop-downtoselectanotherfieldthatisalreadyaddedtothesame
Form.Thecontentsofbothfieldsmustmatchforthedatatobevalidated.Thisisusefulfor
confirmationfieldssuchasforpasswords,emailaddressesetc.
Whichoftheseoptionsareavailabledependsonthevalidationmethodoftheform:withBrowser
validationyoucanonlymakeafieldrequiredandsetamaximumlength.
Changing a Form's validation in HTML
InHTML,thevalidationmethodisstoredinthedata-validation-methodattributeofthe<form>element,
withthevalue"browser"or"jquery-validation".
AcustommessagetobeshownwhenvalidationofaparticularFormelementhasfailed,canbestored
Page 506