Greetings,
I have a RadGrid that does add, edit, and deleting. Thus far, I have done everything serverside on my checks, but I need to do a check clientside and put out an alert for when someone doesn't fill in something. My grid has the following, which isn't much for input fields. It's simply a normal bound column, which is a textbox when adding or editing, and then a template field for a checkbox, but that doesn't have to be checked for validation. I guess my question is, how do you check the textbox for validation using javascript? I've tried several ways, but I get errors. Here is the way I have been trying:
In my code, I found the id of the textfield that is within the grid, then I try to find it, but this does nothing. Anyone have any ideas? Thanks.
Chad
I have a RadGrid that does add, edit, and deleting. Thus far, I have done everything serverside on my checks, but I need to do a check clientside and put out an alert for when someone doesn't fill in something. My grid has the following, which isn't much for input fields. It's simply a normal bound column, which is a textbox when adding or editing, and then a template field for a checkbox, but that doesn't have to be checked for validation. I guess my question is, how do you check the textbox for validation using javascript? I've tried several ways, but I get errors. Here is the way I have been trying:
if (button.get_commandName() == "PerformInsert") |
{ |
var txtid = "ctl00_ctl00_cphContent2_cphAITContent_ctl00_rgdStatusList_ctl00_ctl02_ctl03_ctl01"; |
var txt = $find(txtid); |
if (txt.value.length == 0) |
{ |
alert("You must type something in for Status Description field."); |
} |
} |
In my code, I found the id of the textfield that is within the grid, then I try to find it, but this does nothing. Anyone have any ideas? Thanks.
Chad