let me explain what issue i am facing , i have two cloumns in kendogrid one is dropdown and other is simple textbox
let say dropodown column has (emailadress, website dropdown) now i want to match the exact expression of mail to the other column
if it matches then save the record if not matches than show the toolptip and prevent for saving changes
this is the code
save: function(e) {
// Get the data item being saved
var dataItem = e.model;
// Access properties of the data item and perform actions accordingly
var addressType = dataItem.intInternetAddressTypeID;
var inputField = dataItem.strInternetAddress;
// Perform validation or other actions based on the properties
if (addressType === "2") {
// Email validation for input field
var emailRegex = /^[^\s@@]+@@[^\s@@]+\.[^\s@@]+$/;
if (!emailRegex.test(inputField)) {
// Set validation message on the corresponding cell
e.container.find("[name=strInternetAddress]").closest("td").attr("data-strInternetAddress-msg", "Invalid email address format");
e.preventDefault(); // Prevent saving the record
}
} else if (addressType === "10") {
// Phone number validation for input field
var phoneRegex = /^[0-9]+$/;
if (!phoneRegex.test(inputField)) {
// Set validation message on the corresponding cell
e.container.find("[name=strInternetAddress]").closest("td").attr("data-strInternetAddress-msg", "Invalid phone number format");
e.preventDefault(); // Prevent saving the record
}
}
},
i also enable the tooltip from databound
dataBound: function (e) {
e.sender.element.find("[data-strInternetAddress-msg]").each(function () {
$(this).kendoTooltip({
position: "bottom",
content: $(this).attr("data-strInternetAddress-msg"),
});
});
}but tooltip is not showing in the page , it preventing from saving but not showing tooltip after inspection i found that it creating this html
<td role="gridcell" data-container-for="strInternetAddress" data-strinternetaddress-msg="Invalid email address format"><input type="text" class="k-input k-textbox k-valid" name="strInternetAddress" required="required" data-required-msg="Internet Address is required" data-bind="value:strInternetAddress"></td>
Help me how to show the tooltip not alert i dont want alert
Hi there! I'm not a developer but working with one to try and get a fix for my web application. This specific issue is not happening on any desktop computer but appears to be happening on my MacBook Pro when using Safari (not Chrome) and my 5th Gen iPad in both Safari and Chrome. When access a specific section of the program it begins to 'tab' through every field on that page endlessly. When I check the network log it states 'PerformValidationActions' appears to be in a loop cycling through 'text1_enter' 'text1_leave' 'text2_enter' 'text2_leave' 'text3_enter' 'text3_leave' etc. It EVENTUALLY ends but then when you try to log out you get the error Object reference not set to an instance of an object.
Any help would be GREATLY appreciated!
Hai,
I have two questions :
1) How can I change the width of a GridColumn, as show below? I am currently using GridColumn. Please find attached as reference.
2) How can I use Kendo UI to create a bar graph like the one shown below? The graph should update based on the user-entered values for total occurrence and time period (week/month). Does Kendo UI support this functionality?
Hi,
Demo is http://dojo.telerik.com/UgELisOy
In above demo,
var remoteValidator = {
valid: false,
initiated: false,
check: function(element, validator) {
remoteValidator.initiated = true;
//simulate Ajax
setTimeout(function() {
//TODO: set to true if valid
remoteValidator.valid = true;
validator.validateInput(element);
remoteValidator.initiated = false;
}, 1000);
}
};
The form cannot be submitted normally.
Thank you for your help!
I'm trying to get the validation working on my form with kendovalidator
I'm using Telerik ver : 2019.2.619
$.validator.setDefaults({
ignore: ""
});
$(function () {
$("#form1").kendoValidator();
});
this shows validation messages correctly if values are empty eg:
issue is when an incorrect value is entered the message shows:
<div class="form-group row">
@Html.LabelFor(model => model.CountryCodeId, htmlAttributes: new { @class = "control-label col-md-2 required" })
<div class="col-md-10">
@(Html.Kendo().ComboBoxFor(m => m.CountryCodeId)
.Name("CountryCodeId")
.Placeholder(@Resources.Resources.CountryPlaceholder)
.DataTextField("Description")
.DataValueField("Id")
.Filter("contains")
.Suggest(true)
.DataSource(s => s.Read(r => r.Action("GetCountries", "Customer")).ServerFiltering(false))
.HtmlAttributes(new { style = "width:300px" })
)
@Html.ValidationMessageFor(model => model.CountryCodeId, "", new { @class = "text-danger" })
</div>
</div>
[Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "CountryValidation")]
[Display(ResourceType = typeof(Resources.Resources), Name = "Country")]
public int? CountryCodeId { get; set; }
and if I enter a number the validation seems to pass, which it shouldn't
Validation should pass only if a country is selected from the combobox, entrering a numeric value or any other text which is not on the list should fail validation
How do I get default dataanotation message if an invalid entry is made?
Thanks
<
a
href
=
"javascript:void(0)"
>
<
input
id
=
"FileName"
name
=
"FileName"
type
=
"file"
/>
<
script
>
jQuery(function () {
jQuery("#FileName").kendoUpload();
});
</
script
>
</
a
>