Telerik Forums
Kendo UI for jQuery Forum
0 answers
13 views

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

saurabh
Top achievements
Rank 1
 asked on 17 Apr 2024
0 answers
13 views

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!

Stephen
Top achievements
Rank 1
 asked on 28 Mar 2024
0 answers
53 views

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?


 

Umi Amira
Top achievements
Rank 1
Iron
 asked on 03 May 2023
0 answers
55 views

Hi,

      Method is https://docs.telerik.com/kendo-ui/knowledge-base/remote-validation?_ga=2.30044991.1233608935.1653012997-543877616.1650858150

      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!

                            
sun
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 31 May 2022
0 answers
191 views

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

 

Faz
Top achievements
Rank 1
Iron
 updated question on 23 Aug 2021
0 answers
39 views
Hi All,

I am using the kendo MVVM much like i've been using knockoutjs for the last 2 years.

I see there are some issues or limitations of the custom bindings when it comes to binding init events to template properties.

So.. can i use this validation framework in an MVVM scenario with templates?

I have a table whose rows are templated.. the items are bound to a collection/Array inside my viewModel. I need validation on inputs inside the rows.

ANY information.. examples.. demos much appreciated.
Rich
Top achievements
Rank 1
 asked on 22 Oct 2012
0 answers
79 views
I'm not sure if this is possible. I'm quite new to Kendo UI and so I would like to ask:

Is it possible to force the validator to "put" a default text and style (css class) to the "k-invalid-msg" should the input PASS the validation? Let's say I have an asterisk * for required fields. Should user try to submit an empty form, these asterisks will be replaced by a "required" message. However if the user submits that form again and required fields are filled out I would like to get those asterisks back. It would be lovely if I could manipulate css classes for those cases, like: .warning, .info, .error, .notice, etc...

Thanks for any suggestions.
Ex
Top achievements
Rank 1
 asked on 18 Oct 2012
0 answers
57 views
I have a rather simple kendoUpload button and it mostly works fine,
but in IE9 the user needs to double click the button to get the file
browser window to display.

Also, the user can only click on the button label - clicking (or double
clicking) on the larger button image has no effect.

Here's the code:
<a href="javascript:void(0)">
    <input id="FileName" name="FileName" type="file" />
    <script>
        jQuery(function () {
            jQuery("#FileName").kendoUpload();
    });
    </script>                    
</a>

Thanks!                                             

bergonom
Top achievements
Rank 1
 asked on 16 Oct 2012
0 answers
75 views
Is it possible to validate RadTextBox with Kendo UI Validation?
My code looks like this:

<script type="text/javascript">
$(document).ready(function () {
            $("#contact").kendoWindow({
                actions: ["Maximize", "Minimize", "Close"],
                title: "Contact...",
                visible: false
            }).data("kendoWindow");
            $("#contact").kendoWindow('open');
            $("#contact").kendoValidator();
</script>
...
<div id="contact">
        <table>
            <tr>
                <td>Name :</td>
                <td>
                    <telerik:RadTextBox ID="tbFullName" runat="server" CssClass="k-textbox" EmptyMessage="Please enter your name"  ClientIDMode="Static"></telerik:RadTextBox></td>
                <td><span class="k-invalid-msg" data-for="tbFullName"></span></td>
            </tr>
        </table>
    </div>

For testing purposes, I tried kendoWindow() so that I can be sure that all links are ok and Kendo Window worked perfekt.
But unfortunately Kendo Validation didn't works for me with RadTextBox. If I use <input> tags intead of RadTextBox
everything works fine.

I hope that someone can help me. Thanks in advance.
Christian
Top achievements
Rank 1
 asked on 16 Oct 2012
0 answers
73 views
Please see attached screenshot from Internet Explorer 8. My validation tooltips appear behind DropDownLists. I'm no css guru so I would appreciate some help. As far as I can tell the tooltips have a higher z-index than the DropDownLists.
Remco
Top achievements
Rank 1
 asked on 09 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?