---
{
	"title": "Merge Server-Client Errors",
	"language": "en",
	"category": "Plugins",
	"description": "Merge server errors with client errors",
	"tag": "formvalid-server",
	"parentdir": "formvalid",
	"altLangPrefix": "formvalid-server",
	"dateModified": "2022-04-13"
}
---

<ul>
	<li><a href="formvalid-en.html">Form Validation</a></li>
	<li><a href="formvalid-server-en.html">Merge Server-Client Errors</a></li>
</ul>

<hr />

<section>
	<h2>Purpose</h2>
	<p>This component merges Server and Client errors together.</p>
</section>

<section>
	<h2>Example</h2>

	{{>alertariahidden}}

	<p>After submitting your page, the server returned 7 server errors. Now if you try to resubmit your form with some
		client errors, the component will add these errors to the existing server errors.</p>
	<p>To test: Try clearing a field or enter 201 as the Beneficiary's age or uncheck all checkboxes.</p>

	<h2>
		<span id="lblTitle" property="name">Demo Asp.Net Web Form</span>
	</h2>

	<div class="wb-frmvld">
		<form id="frmMain" action="#" method="get">


			<section class="panel panel-info">
				<header class="panel-heading">
					<h2 class="panel-title">
						Section 1
					</h2>
				</header>
				<div class="panel-body">

					<div class="form-group">
						<label class="required" for="MainContent_TypeOfPrestation">
							<span class="field-name">Type of benefit</span>
							<strong class="required">(Required field)</strong>
						</label>

						<div>
							<select name="ctl00$MainContent$TypeOfPrestation" id="MainContent_TypeOfPrestation" required="required">
								<option value="">Select a benefit</option>
								<option value="ChildrenHelp">Child benefit (Age 1-18) </option>
								<option value="Invalidity">Invalidity (Age 1-64)</option>
								<option selected="selected" value="Retirement">Retirement (Age 65-200)</option>
							</select>
						</div>
					</div>

					<fieldset>
						<legend>Beneficiary</legend>
						<div class="form-group">
							<label class="required" for="MainContent_BeneficiaryName">
								<span class="field-name">Beneficiary name</span>
								<strong class="required">(Required field)</strong>
								<span class="label label-danger wb-server-error" id="MainContent_BeneficiaryNameCv">The name should begin with "Super"</span> </label>
							<input name="ctl00$MainContent$BeneficiaryName" class="form-control valid" id="MainContent_BeneficiaryName" aria-invalid="false" required="required" type="text" maxlength="16" value="Me">
						</div>

						<div class="form-group">
							<label class="required">
								<span class="field-name">Beneficiary age</span>
								<strong class="required">(Required field)</strong>
								<span class="label label-danger wb-server-error" id="MainContent_BeneficiaryAgeCv">Age should be between 64 and 200 for a Retirement benefit</span>
								<input name="ctl00$MainContent$BeneficiaryAge" class="form-control css-implicite-input valid" id="MainContent_BeneficiaryAge" aria-invalid="false" required="required" type="number" min="1" max="200" step="1" value="52">
							</label>
						</div>
					</fieldset>

					<fieldset class="legend-brdr-bttm">
						<legend class="required"><span class="field-name">Citizen Status</span> <strong class="required">(Required field)</strong></legend>
						<div class="radio required"><label for="MainContent_wbRadioButtonList0_radioButtonList0_0"><input name="radioButtonList0" id="MainContent_wbRadioButtonList0_radioButtonList0_0" required="required" type="radio" checked="checked" value="radioButtonList0_0v"><span> Canadian citizen</span> </label></div>
						<div class="radio">
							<label for="MainContent_wbRadioButtonList0_radioButtonList0_1"><input name="radioButtonList0" id="MainContent_wbRadioButtonList0_radioButtonList0_1" type="radio" value="radioButtonList0_1v"><span> Permanent resident</span> </label></div>
						<div class="radio">
							<label for="MainContent_wbRadioButtonList0_radioButtonList0_2"><input name="radioButtonList0" id="MainContent_wbRadioButtonList0_radioButtonList0_2" type="radio" value="radioButtonList0_2v"><span> Work permit</span></label></div>
					</fieldset>

					<fieldset class="legend-brdr-bttm">
						<legend class="required"><span class="field-name">Contact Information</span> <strong class="required">(Required field)</strong><span class="label label-danger wb-server-error" id="MainContent_wbCheckBoxList0Cv">You can't choose more than 2 checkboxes</span></legend>
						<div class="checkbox"><label for="MainContent_wbCheckBoxList0_checkBoxList0_0">
								<input name="checkBoxList0" class="required_js valid" id="MainContent_wbCheckBoxList0_checkBoxList0_0" aria-invalid="false" required="required" type="checkbox" checked="checked" value="checkBoxList0_0v">
								<span> <span class="field-name">Contact me by email</span></span>
							</label></div>
						<div class="checkbox"><label for="MainContent_wbCheckBoxList0_checkBoxList0_1"><input name="checkBoxList0" id="MainContent_wbCheckBoxList0_checkBoxList0_1" type="checkbox" checked="checked" value="checkBoxList0_1v"><span> <span class="field-name">Contact me by phone</span></span> </label></div>
						<div class="checkbox"><label for="MainContent_wbCheckBoxList0_checkBoxList0_2"><input name="checkBoxList0" id="MainContent_wbCheckBoxList0_checkBoxList0_2" type="checkbox" checked="checked" value="checkBoxList0_2v"><span> <span class="field-name">Contact me by text messaging</span></span></label></div>
					</fieldset>

					<fieldset class="legend-brdr-bttm">
						<legend class="required"><span class="field-name">Signature</span> <strong class="required">(Required field)</strong></legend>
						<div class="checkbox"><label for="MainContent_wbCheckBoxList1_checkBoxList1_0"><input name="checkBoxList1" class="required_js valid" id="MainContent_wbCheckBoxList1_checkBoxList1_0" required="required" type="checkbox" checked="checked" value="checkBoxList1_0v"><span> <span class="field-name">Print this page</span></span> </label></div>
						<div class="checkbox"><label for="MainContent_wbCheckBoxList1_checkBoxList1_1"><input name="checkBoxList1" id="MainContent_wbCheckBoxList1_checkBoxList1_1" type="checkbox" value="checkBoxList1_1v"><span> <span class="field-name">Please send me more information</span></span> </label></div>
						<div class="checkbox required"><label for="MainContent_wbCheckBoxList1_checkBoxList1_2"><input name="checkBoxList1" id="MainContent_wbCheckBoxList1_checkBoxList1_2" aria-invalid="false" required="required" type="checkbox" value="checkBoxList1_2v"><span> <span class="field-name">I agree with the directives</span><strong class="required"> (Required field)</strong></span><span class="label label-danger wb-server-error" id="MainContent_wbCheckBoxList1_checkBoxList1_2Cv">This field is mandatory</span></label></div>
					</fieldset>

					<fieldset class="form-inline chkbxrdio-grp">
						<legend class="required"><span class="field-name">Work Status</span> <strong class="required">(Required field)</strong><span class="label label-danger wb-server-error" id="workError">You must select No for this question.</span></legend>
						<label class="radio-inline">
							<input class="input-validation-error" data-msg-required="You must select Yes or No." data-rule-required="true" id="workNo" name="workStatus" type="radio" value="No" />
							No
						</label>
						<label class="radio-inline">
							<input class="input-validation-error" id="workYes" checked="checked" name="workStatus" type="radio" value="Yes" />
							Yes
						</label>
					</fieldset>

					<fieldset class="form-inline chkbxrdio-grp">
						<legend class="required"><span class="field-name">New Vacation Destinations</span> <strong class="required">(Required field)</strong><span class="label label-danger wb-server-error" id="vacationError">You have already been to Mexico.</span></legend>
						<div class="label-inline">
							<input type="checkbox" checked="checked" name="vacationDestination" id="dest1" required="required" />
							<label for="dest1">Mexico</label>
						</div>
						<div class="label-inline">
							<input type="checkbox" name="vacationDestination" id="dest2" />
							<label for="dest2">Italy</label>
						</div>
						<div class="label-inline">
							<input type="checkbox" name="vacationDestination" id="dest3" />
							<label for="dest3">Germany</label>
						</div>
					</fieldset>

					<fieldset class="form-inline chkbxrdio-grp">
						<legend class="required"><span class="field-name">Owned pets</span> <strong class="required">(Required field)</strong><span class="label label-danger wb-server-error" id="petError">A deer is not a pet.</span></legend>
						<label class="checkbox-inline"><input type="checkbox" checked="checked" name="petChoice" id="petDeer" required="required" /> Deer</label>
						<label class="checkbox-inline"><input type="checkbox" name="petChoice" id="petCat" /> Cat</label>
						<label class="checkbox-inline"><input type="checkbox" name="petChoice" id="petDog" /> Dog</label>
					</fieldset>

					<ul class="list-inline">
						<li><input name="ctl00$MainContent$btnSubmit" class="btn btn-primary" id="MainContent_btnSubmit" onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContent$btnSubmit", "", true, "", "", false, false))' type="submit" value="Submit"></li>
					</ul>
				</div>
			</section>
		</form>
	</div>
</section>
