Skip to content

Commit c8f1daf

Browse files
author
pipeline
committed
config(EJ2-5149): commit for adding description in form-validator master
1 parent 78a2018 commit c8f1daf

File tree

5 files changed

+57
-26
lines changed

5 files changed

+57
-26
lines changed

src/form-validator/default-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/form-validator/default.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ export class DefaultFormValidatorComponent implements OnInit {
1616

1717
ngOnInit(): void {
1818
this.formValidator = {
19+
// Initialize custom placement
1920
customPlacement: (inputElement: HTMLElement, errorElement: HTMLElement) => {
2021
inputElement.parentElement.appendChild(errorElement);
2122
}
2223
};
24+
// Initialize form-validator
2325
let formObj: FormValidator;
2426
formObj = new FormValidator('#formId', this.formValidator);
2527
}

src/form-validator/default.html

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,13 @@
145145
</div>
146146
</div>
147147
<div id="description">
148+
<div class="description-header">Description</div>
148149
<p>
149-
FormValidator can be used to validate form input elements with the required validation rules.
150+
Form Validator can be used to validate the form input elements with the required validation rules.
150151
</p>
151152
<br>
152153
<p>
153-
The above form is configured with following rules and also we have given example valid values for each field.
154+
The above form is configured with the following rules and also, we have given the examples of valid values for each field.
154155
</p>
155156
<table style="width:100%">
156157
<tr>
@@ -160,27 +161,27 @@
160161
</tr>
161162
<tr>
162163
<td>Required</td>
163-
<td>The field must have any value</td>
164+
<td>The field must have any value.</td>
164165
<td>value</td>
165166
</tr>
166167
<tr>
167168
<td>Email</td>
168-
<td>The input must have email format</td>
169-
<td>test@syncfusion.com</td>
169+
<td>The input must have email format.</td>
170+
<td>info@syncfusion.com</td>
170171
</tr>
171172
<tr>
172173
<td>URL</td>
173-
<td>The input must have URL format</td>
174-
<td>https://www.google.co.in/</td>
174+
<td>The input must have URL format.</td>
175+
<td>https://www.syncfusion.com/</td>
175176
</tr>
176177
<tr>
177178
<td>Date</td>
178-
<td>The input must have javascript date format</td>
179+
<td>The input must have JavaScript date format.</td>
179180
<td>04/13/2017</td>
180181
</tr>
181182
<tr>
182183
<td>Date ISO</td>
183-
<td>The input must have date ISO format</td>
184+
<td>The input must have date ISO format.</td>
184185
<td>2017-04-13</td>
185186
</tr>
186187
<tr>
@@ -190,43 +191,61 @@
190191
</tr>
191192
<tr>
192193
<td>Digits</td>
193-
<td>The input must have digit format</td>
194+
<td>The input must have digit format.</td>
194195
<td>1</td>
195196
</tr>
196197
<tr>
197198
<td>Max Length</td>
198-
<td>The input value must have less than 5 characters length</td>
199-
<td>test</td>
199+
<td>The input value must have less than 5 characters length.</td>
200+
<td>world</td>
200201
</tr>
201202
<tr>
202203
<td>Min Length</td>
203-
<td>The input value must have more than 5 characters length</td>
204-
<td>testing</td>
204+
<td>The input value must have more than 5 characters length.</td>
205+
<td>syncfusion</td>
205206
</tr>
206207
<tr>
207208
<td>Range Length</td>
208-
<td>The input must have number value from 5 to 10 characters length</td>
209-
<td>testing</td>
209+
<td>The input must have number value from 5 to 10 characters length.</td>
210+
<td>syncfusion</td>
210211
</tr>
211212
<tr>
212213
<td>Max</td>
213-
<td>The input must have number value less than or equal to 5</td>
214+
<td>The input must have number value less than or equal to 5.</td>
214215
<td>4</td>
215216
</tr>
216217
<tr>
217218
<td>Min</td>
218-
<td>The input must have number value greater than or equal to 5</td>
219+
<td>The input must have number value greater than or equal to 5.</td>
219220
<td>6</td>
220221
</tr>
221222
<tr>
222223
<td>Regex</td>
223-
<td>You can use regex to validate the input. The input must be alphabets</td>
224-
<td>abc</td>
224+
<td>You can use regex to validate the input. The input must be alphabets only.</td>
225+
<td>contact</td>
225226
</tr>
226227
</table>
227228
<br>
228229
<p>
229-
You can enter the above values in the corresponding input elements and click the subit button to validate the form. The reset
230-
button can wipe out all the input values in the form.
230+
You can enter the above values in the corresponding input elements and click the submit button to validate the form. The
231+
reset button can wipe out all the input values in the form.
231232
</p>
232-
</div>
233+
</div>
234+
235+
<style>
236+
.e-error,
237+
.e-float-text {
238+
font-weight: 500;
239+
}
240+
241+
table,
242+
td,
243+
th {
244+
padding: 5px;
245+
}
246+
247+
.form-horizontal .form-group {
248+
margin-left: 0px;
249+
margin-right: 0px;
250+
}
251+
</style>

src/form-validator/form-validator.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const formValidatorAppRoutes: Object[] = [
88
path: ':theme/form-validator/default',
99
component: DefaultFormValidatorComponent,
1010
name: 'Default Functionalities',
11-
category: 'Form-Validator'
11+
category: 'Form Validator'
1212
}
1313
];
1414

styles/index.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,4 +1535,14 @@ propertye pane
15351535

15361536
.sb-hide {
15371537
display: none;
1538-
}
1538+
}
1539+
1540+
/* Description Format */
1541+
1542+
#description {
1543+
margin: 30px;
1544+
padding: 15px;
1545+
background: #f0f0f0;
1546+
border: 1px solid #dddddd;
1547+
display: block;
1548+
}

0 commit comments

Comments
 (0)