Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2006, 08:27 AM
Authorized User
 
Join Date: Jun 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript Problem

Hi

I have written javascript for adding teo values.but it not added but give concate result.

var Store='';
         function myfun(id,value)
         {
             var Tchk;
             var str=value;
             Tchk=document.getElementById(id).checked
             if(Tchk==true)
             {

                    Rate= str + Store;
              }
              Store=Rate
           }

suppose str=123
store=456
I get result as Rate=123456
But i want 579

what i do?

Thanks
monika

 
Old December 3rd, 2006, 07:04 AM
Authorized User
 
Join Date: Sep 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

The answer is quite simple

Rate= parseInt(str) + parseInt(Store;)

this solves ur answer
:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Problem suresh_accudocs ASP.NET 1.0 and 1.1 Professional 1 July 24th, 2007 06:04 PM
javascript problem dk6607 ASP.NET 1.0 and 1.1 Basics 10 October 2nd, 2006 12:56 PM
JavaScript Problem @shish ASP.NET 1.0 and 1.1 Basics 1 April 3rd, 2006 10:26 AM
Javascript Problem dparsons ASP.NET 1.0 and 1.1 Basics 2 March 22nd, 2006 01:41 PM
Javascript problem highcliffevillage Javascript How-To 0 July 8th, 2004 07:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.