Skip to content

Commit 9d0b3c7

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 7dc0ed1 commit 9d0b3c7

File tree

3 files changed

+114
-2
lines changed

3 files changed

+114
-2
lines changed

docs/api/javascript/ui/form.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,110 @@ By default, the Form is rendered with vertical orientation.
206206
});
207207
</script>
208208

209+
### messages `Object`
210+
211+
Configures text messages displayed in the Form. Use it to customize or localize the Form messages.
212+
213+
#### Example - customize form submit and clear buttons messages
214+
215+
<form id="myForm"></form>
216+
217+
<script>
218+
$("#myForm").kendoForm({
219+
orientation: "horizontal",
220+
formData: {
221+
ID: 1,
222+
Name: "Ivan"
223+
},
224+
items: [{
225+
field: "Name",
226+
label: "Name:"
227+
}],
228+
messages: {
229+
submit: "Custom Submit Button Text",
230+
clear: "Custom Clear Button Text"
231+
}
232+
});
233+
</script>
234+
235+
### messages.submit `String` *(default: "Submit")*
236+
237+
The text message displayed for the Form submit button.
238+
239+
#### Example - set the submit button message
240+
241+
<form id="myForm"></form>
242+
243+
<script>
244+
$("#myForm").kendoForm({
245+
orientation: "horizontal",
246+
formData: {
247+
ID: 1,
248+
Name: "Ivan"
249+
},
250+
items: [{
251+
field: "Name",
252+
label: "Name:"
253+
}],
254+
messages: {
255+
submit: "Custom Submit Button Text"
256+
}
257+
});
258+
</script>
259+
260+
### messages.clear `String` *(default: "Clear")*
261+
262+
The text message displayed for the Form clear button.
263+
264+
#### Example - set the clear button message
265+
266+
<form id="myForm"></form>
267+
268+
<script>
269+
$("#myForm").kendoForm({
270+
orientation: "horizontal",
271+
formData: {
272+
ID: 1,
273+
Name: "Ivan"
274+
},
275+
items: [{
276+
field: "Name",
277+
label: "Name:"
278+
}],
279+
messages: {
280+
clear: "Custom Clear Button Text"
281+
}
282+
});
283+
</script>
284+
285+
### messages.optional `String` *(default: "(Optional)")*
286+
287+
The text message displayed next to a field label when the [items.label.optional](items.label.optional) option is set to `true`.
288+
289+
#### Example - set the clear button message
290+
291+
<form id="myForm"></form>
292+
293+
<script>
294+
$("#myForm").kendoForm({
295+
orientation: "horizontal",
296+
formData: {
297+
ID: 1,
298+
Name: "Ivan"
299+
},
300+
items: [{
301+
field: "Name",
302+
label: {
303+
text: "Name:",
304+
optional: true
305+
}
306+
}],
307+
messages: {
308+
optional: "(Optional field)"
309+
}
310+
});
311+
</script>
312+
209313
### validatable `Object`
210314

211315
Configures the built-in Validator options.

src/kendo.datepicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ var __meta__ = { // jshint ignore:line
540540

541541
that._old = that._update(value);
542542

543-
if (that._old === null) {
543+
if (that._old === null && !that._dateInput) {
544544
that.element.val("");
545545
}
546546

@@ -681,7 +681,7 @@ var __meta__ = { // jshint ignore:line
681681
if (+date === +current && isSameType) {
682682
formattedValue = kendo.toString(date, options.format, options.culture);
683683

684-
if (formattedValue !== value) {
684+
if (formattedValue !== value && !(that._dateInput && !date)) {
685685
that.element.val(date === null ? value : formattedValue);
686686
}
687687

tests/datepicker/api.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ it("readonly calls dateinput _editable method", function() {
620620
assert.equal(atStub.calls("_editable"), 1);
621621
});
622622

623+
it("value method should not clear DateInput format", function() {
624+
var datepicker = new DatePicker(input, {
625+
dateInput: true
626+
});
627+
datepicker.value("");
628+
assert.isOk(datepicker.element.val());
629+
});
630+
623631
it("enable calls dateinput _editable method", function() {
624632
var datepicker = new DatePicker(input, {
625633
dateInput: true

0 commit comments

Comments
 (0)