Need functions that extend the default validation checking for jqGrid

Posted on 2011-10-11
Last Modified: 2013-01-28
I have a jqGrid which is returning the same message twice, since I am using the built in validation to validate two related fields. They need to have the same message, so I need a way to only display the message once.

The error message box is created by Ajax/jqGrid and I do not know how to drill down and find that message.

Can someone please tell me how to define a custom validation function that extend the default validation checking?  The line where the error message is defined here:

+ "data-val-remote-url='/Ajax/IsConcEnough' data-val-remote-additionalfields='SubmissionID,samples[{0}].Vol' data-val-remote='Provided Volume and Concentration are not enough' data-val-remote-type='POST' "

I would like to call a function instead os using a string to set the data-val-remote parameter. And I would like to return a null string in the event the other control also has a value set for the  data-val-remote parameter.

Question by:newbieweb
    LVL 81

    Expert Comment

    could you provide a link to your page?
    LVL 81

    Accepted Solution


    Author Comment

    My site is internal use, and this change is not yet deployed. Funny, that was my question in an earlier day of me working with jqGrid validation.

    Today I tested using C# code in the creationof the Ajax return error string values at page load. And that works!

    BUT, seems rather like an oversight, but while I am able to set a max and a min value of the field, I seem only allowed one range message. First one defined, rules.


    data-val-range seems to hold the message. Any idea how to get BOTH a min and a max message?

    Author Closing Comment

    Hi, that link helped a bit.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
    Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
    Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now