Addition en javascript


Back to questions réponses.


*719d2c    (2009-03-23)
Addition en javascript

Salut tout le monde,

Voilà, je suis en train de découvrir le langage Javascript que j'incorpore dans mon code HTML sur <A ONCLICK=""> mais quand j'essaie de faire une addition entre deux valeurs form.name.value1 et form.name.value2 ça me retourne la concaténation de ces deux valeurs et non l'addition.

D'où la question : Comment fait-on pour additionner en javascript ?

Merci d'avance.



(more options below)

*1f562f    (2009-03-26 11:53:11)
Addition en javascript

Essaie avec la fonction parseInt(), du style

a = parseInt(form.name.value1) + parseInt(form.name.value2)


Ca devrait mieux marcher


ficgs
Suggestions


ficgs
Plus de sources

Vous devez vous enregistrer pour consulter ces sources, vous pourrez alors changer leur ordre en cliquant sur les icones les précédant.



admin
Autres sources

Ce projet est collaboratif, vous pouvez remonter les sources suivantes dans la liste si vous les trouvez utiles.


 JavaScript Tutorial - Lesson 4: JavaScript Operations on Variables
functionx > javascript/Lesson04.htm

 simple addition in javascript : addition, javascript
experts exchange > Programming/Misc/Q 21028069

 Addition in javascript
p2p.wrox > vbscript/45216

 Javascript addition problem.
computing > answers/programming/javascript

PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING...
I'd go with the first option as that would corerct the issue at the...

 JavaScript - Addition Through Javascript | DreamInCode.net
dreamincode > forums/showtopic17415.htm

 how to perform addition in javascript - VB.NET
daniweb > forums/thread91856

Just looking for directions to follow and work on and not the...
No one has posted to this discussion for at least three...

 simple addition in Javascript [Archive] - WebDeveloper.com
webdeveloper > forum/archive/index.php/t 50553

That's probably because you didn't the define the variable: isA...

 Javascript: les opérateurs
commentcamarche > contents/javascript/jsop.php3

Si vous avez un de ces messages lorsque vous essayer d'introduire une...
Qu'est-ce qu'une structure conditionnelle' On appelle structure...

 Javascript addition not working!? - Yahoo! Answers
answers.yahoo > question/index?qid=20080630034433AAX8hxE

How can I make sure java script is working on my...
I just won 1st place in Website Development for FBLA State...

 javascript addition
houseoffusion > groups/cf talk/thread.cfm/threadid:14269

You might try adding a ParseInt() function around the value as...
JavaScript is case sensitive, so that should be parseInt() rather...

 l' * - Forum des développeurs
developpez > forums/d431811/webmasters developpement web/javascript/l

et au lieu de m'afficher le total, ça m'affiche d'abord...
Salut, Pourquoi faire un parseInt(total), alors que total est...

 Javascript - General Introduction
quirksmode > js/intro

DOM Scripting: Web Design with JavaScript and the Document Object...
in Netscape 4 can have some unexpected side effects that are too...

 Streamline JavaScript addition and add settings storage | drupal.org
drupal > node/76637

 Basic Javascript Addition Calculator - Overclock.net - Overclocking.net
overclock > web coding/148485 basic javascript

Never mind! I figured it out! I put this function between the...
ame_toggle_view({other : 'true',post : 'true',blog : 'true',group :...

 Download Addition Of Two Number Using Javascript Source Codes, Addition Of Two Number Using Javascript Scripts - Calender Popup by Excentrics World, L...
sourcecodeonline > list

Tigra Menu is free JavaScript menu navigation component for web sites...
JavaScript Slideshow by BarelyFitz is a cool, compact and an amazing...

 About Our Web Site
zytrax > about site.htm

This button indicates that the POP-UP/POP-OUT/DROP-DOWN menus use CSS...
This button indicates that the page has been modified to use modern...

 CodeAve.com/JavaScript - Title Addition
codeave > JavaScript/code.asp?u log=7054

 Opera: Tutorial - User Javascript
opera > browser/tutorials/userjs/using

 50 Useful JavaScript Tools | Developer's Toolbox | Smashing Magazine
smashingmagazine > 2009/02/08/50 extremely useful javascript tools

 JavaScript 3-10x Faster On iPhone OS 3.0
theappleblog > 2009/03/27/javascript 3 10x faster on iphone os 30

 Allowing only certain sites to use JavaScript - MozillaZine Knowledge Base
kb.mozillazine > Allowing only certain sites to use JavaScript

can have multiple websites separated by spaces, like...

 Modelworks Software Javascript Editor
modelworks > editors/javascript

 JavaScript Date Addition - ASP Free
forums.aspfree > asp development 5/javascript date

controlling date and time formats in an asp-generated...
accessing controls embedded in a user control via...

 Amazon.com: JavaScript: Don Gosselin: Books
amazon > JavaScript Don Gosselin/dp/1423901509

' + adPropertiesDelimiter + 'description' +...
' + adPropertiesDelimiter + 'visibleUrl' +...

 nanaze.com: Debugging JavaScript on Android
nanaze > 2009/01/debugging javascript on android

 Spamhuntress » Javascript redirect
spamhuntress > javascript redirect

 Hack: Useful (albeit trivial) javascript addition | Gallery
gallery.menalto > node/727

 Addition in Javascript - Javascript & Ajax @ tutorials.de: Forum, Tutorial, Anleitung, Schulung & Hilfe
tutorials > forum/javascript ajax/233308

 On jQuery and JavaScript… — Degutis.org
degutis > dev/2009/03/14/on jquery and javascript

 Greasemonkey - Wikipedia, the free encyclopedia
en.wikipedia > wiki/Greasemonkey

 jQuery Dynamic Form Field Addition - JavaScript - Snipplr
snipplr > view/6431/jquery dynamic form field

 Introduction to JavaScript
cs.grinnell > ~walker/courses/105.sp04/labs/javascript intro 1.shtml

into your browser, and record what happens in each of the...
follows the same general format as the html pages we have seen...

 JavaScript Public Archive Code Addition
designerwiz > JavaScripts/JavaScript

 JavaScript Addition - CodeGuru Forums
codeguru > forum/showthread.php?t=417361

 question about Javascript addition precision - SitePoint Forums
sitepoint > forums/showthread.php?t=5181



Response  
 

Guest name   (option)     Register
Please sum : 830 + three  




Trackbacks : If you talked about this article in your blog or website, you may instantly get a backlink 
There's no trackback at the moment.