TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tausif shaikh
NA
12
0
calculation with validation
Mar 8 2010 2:16 AM
function Sum()
{
var txtVal1= document.getElementById('<%= txtVal1.ClientID %>').value;
var txtVal2 = document.getElementById('<%= txtVal2.ClientID %>').value;
if(txtVal1.toString().replace(/_/g,' ').trim().length==0)
{
txtVal1="0";
}
if(txtVal2.toString().replace(/_/g,' ').trim().length==0)
{
txtVal2="0";
}
var result= parseFloat(txtVal1) + parseFloat(txtVal2);
document.getElementById('<%= txtAnswer.ClientID %>').value= result ;
}
hi,,,i made one javascript as given above to calculate the value of 2 textbox and give answer in 3rd textbox ,,if i dont apply any value in a textbox it will automatcally consider value with zero..but its not working,,,give me some idea..with code,,thnx
Reply
Answers (
1
)
Xml serialization and Deserialization
how to give unique id's to images?