Click here to Skip to main content
15,898,035 members

Comments by udaysimha (Top 26 by date)

udaysimha 22-Mar-12 4:32am View    
Following is the my code:
function addDropdown(GUID) {
var newSelect = $("<select id='SelectedRoles" + index + "' önchange='addoperand(" + index + ")' name='SelectedRoles" + index + "'></select>");
for (var i = 0; i < ddlOperand.length; i++) {
if (GUID != '' && GUID != null) {
newSelect.append("<option value='" + GUID + "'>" + ddlOperand[i] + "</option>");
}
else {
newSelect.append("<option value='" + ddlOperand[i] + "'>" + ddlOperand[i] + "</option>");
}
}
var newimage = $("<br/><img önclick='closeselectederow(" + index + ")' id='img" + index + "' src='../../images/cancel_cross.png'/>"); /* uday */
$("#addcritiriatable").append(newimage); /* uday */
$("#addcritiriatable").append(newSelect);
index++;
}
// removing controls dynamically./* uday */
function closeselectederow(index) {
$("#img" + index).remove();
$("#SelectedRoles" + index).remove();
$("#opratorddl" + index).remove();
$("#operandvaluesrddl" + index).remove();

}


<table id="addcritiriatable" border="10" style ="height:auto;">


</table>
udaysimha 23-Nov-11 0:19am View    
Hi boss,

I changed code like you suggested,and i execute my application by giving wrong input that is like 423.1, customvalidator is returning true and the rest of controls in page are not validating by Requiredfield validator and page returning true then system throwing "input string was not in corret format" .

Is IndexOf() is available to the function Chkdecimalvalidation(sender, args)?
udaysimha 22-Nov-11 8:57am View    
hi bossplease explain me under standable form, yes i am a BAD programer....
whether the way i am following is right? give me your valuble suggetions.
udaysimha 22-Nov-11 8:23am View    
yes now i understood what your said, i tryed like below

function Chkdecimalvalidation(sender, args)
{
var s = args.Value;

var decPos = s.IndexOf('.') + 1;
if (decPos >= 1 && (s.Length - decPos) > 3)
{
args .IsValid=true ;
}
else
{
args .IsValid=false ;
}
}

even thought i did`t result.
udaysimha 22-Nov-11 6:04am View    
HiI looked at your exampls and links, in that founds only index of a specified character.
Here my requirement is to find decimal point if it exits and no.of digits after decimal.If there is no decimal point no need to check the user input.

I am calling Chkdecimalvalidation(serber, args) function from CustomValidator here.