...

View Full Version : JavaScript field validation issue



vectrex
06-02-2009, 01:16 PM
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 -


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.

Kor
06-02-2009, 02:43 PM
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?

vectrex
06-02-2009, 03:56 PM
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. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum