Hello In my radgrid one edit form .. i will update some values.. I handle some java script code for validation
Their one textbox UPC .. if UPC code is not valid it will show alert message.. after showing alert message when i tried to click on cancel. It will again and again warn me "Invalide UPC".. it's not handle cancel button click.
Code for UPC textbox
javascript
function validateUPC(txtUPC) {
debugger;
var txtboxUPC = document.getElementById(txtUPC);
if (txtboxUPC.value.length != 12) {
alert('Invalid UPC Barcode');
txtboxUPC.focus();
return false;
}
if (!validateUPCCode(txtboxUPC.value)) {
alert('Invalid UPC Barcode');
txtboxUPC.focus();
return false;
}
code behind cs file to call javascript on textbox onblur
On cancel button click
javascript
function RaiseCancel(sender, args) {
if (args.get_commandName() == "CancelUpdate")//check for the condition
{
//your code here
}
}
<ClientSettings>
<ClientEvents OnCommand="RaiseCancel" />
</ClientSettings>
It's does not raise event cancel. I don't know why this is happen ...
Help me urgent
plz find attach file u get an idea
Their one textbox UPC .. if UPC code is not valid it will show alert message.. after showing alert message when i tried to click on cancel. It will again and again warn me "Invalide UPC".. it's not handle cancel button click.
Code for UPC textbox
javascript
function validateUPC(txtUPC) {
debugger;
var txtboxUPC = document.getElementById(txtUPC);
if (txtboxUPC.value.length != 12) {
alert('Invalid UPC Barcode');
txtboxUPC.focus();
return false;
}
if (!validateUPCCode(txtboxUPC.value)) {
alert('Invalid UPC Barcode');
txtboxUPC.focus();
return false;
}
code behind cs file to call javascript on textbox onblur
TextBox txtGameUPC = (TextBox)editForm.FindControl("txtGameUPC");
txtGameUPC.Visible = true;
txtGameUPC.Enabled = false;
//Call Java script function to validate the UPC code
txtGameUPC.Attributes.Add("onblur", "validateUPC('" + txtGameUPC.ClientID + "');");
On cancel button click
javascript
function RaiseCancel(sender, args) {
if (args.get_commandName() == "CancelUpdate")//check for the condition
{
//your code here
}
}
<ClientSettings>
<ClientEvents OnCommand="RaiseCancel" />
</ClientSettings>
It's does not raise event cancel. I don't know why this is happen ...
Help me urgent
plz find attach file u get an idea