validate input in datagrid

Discussion in 'ASP .Net' started by =?Utf-8?B?bWF0cw==?=, May 13, 2004.

  1. Hell

    My problem is that I do not know how to validate input that I let the user type into my datagrid
    In one grid I let the user to type in a value into a template column - how do I make sure that this input is an integer on the client sid
    In a diffrent grid I have an edit command column and the same problem - how do I make sure that this is an integer on the client sid

    Any suggestion
     
    =?Utf-8?B?bWF0cw==?=, May 13, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?bWF0cw==?=

    avnrao Guest

    you access the table created by the datagrid. loop thru the elements and
    access it.
    write a javascript like follows..

    // to access the rows in the table
    var iRows = document.all("tablename").rows;
    var oCell;
    var columnNumber = 0; // your column number in which the control to validate
    exists.
    for(var iIndex=1; iIndex < iRows.length; iIndex++)
    {
    oCell = iRows[iIndex].cells[columnNumber];
    alert(oCell.all[indextoyourcontrol]); // check and get the index for
    your control to validate.
    }

    hth,
    Av.

    "mats" <> wrote in message
    news:...
    > Hello
    >
    > My problem is that I do not know how to validate input that I let the user
    > type into my datagrid.
    > In one grid I let the user to type in a value into a template column - how
    > do I make sure that this input is an integer on the client side
    > In a diffrent grid I have an edit command column and the same problem -
    > how do I make sure that this is an integer on the client side
    >
    > Any suggestions
    >
     
    avnrao, May 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grey

    Validate date input

    Grey, Jan 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    648
    Peter Blum
    Jan 21, 2004
  2. Grey
    Replies:
    3
    Views:
    13,817
    grish
    Oct 9, 2012
  3. Peter Afonin

    How to validate input characters encoding

    Peter Afonin, Feb 1, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,207
    Peter Afonin
    Feb 2, 2004
  4. =?Utf-8?B?bnR1c2VyX21hbkBtc2RuLmNvbQ==?=

    Validate csv input

    =?Utf-8?B?bnR1c2VyX21hbkBtc2RuLmNvbQ==?=, Mar 1, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,061
    bulat
    Oct 19, 2009
  5. ibiza
    Replies:
    7
    Views:
    39,985
    jasonHall
    Jan 11, 2011
Loading...

Share This Page