Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JavaScript field validation issue

    i'm attempting to validate data entries on a custom DataGrid in ASP, i'm able to validate a single field but I can't validate multiple fields. I don't know if its a syntax issue but the following code only displays an error message for the NAME field and not for the ID field -

    Code:
        function gx_AddingRecord(r, ID, NAME) {
            var value = r.getCellByColumnKey('ID', 'NAME').getValue();
            if (value == "") {
                alert('A value is required for this cell');
                return true;
            }
        }
    What am I doing wrong? How can I get the error message to display if the ID field is left blank? Any help appreciated, thanks.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Too vague. Insufficient information.

    And where the getCellByColumnKey() and getValue() functions/methods came from (they are not native javascript)? Do you use a framework? Which one? And where do you call the function from? Do you use a loop?
    Last edited by Kor; 06-02-2009 at 01:46 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm using additional controls called Janus GridEX which is a replacement for the standard gridview in Visual Studio as I needed some additional functionality. Now the problem lies in validating user inputs. Those functions were provided by the developers of the controls but only seems to work if a single cell in the grid needs validating.

    The function is called on page load from the .cs file. Hope that helps to gain an understanding of the problem.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •