Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
3a5f04a8
Commit
3a5f04a8
authored
Sep 19, 2018
by
Mat
Browse files
calcule le total
parent
98e3922c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/PotageBundle/Resources/views/Membre/today.js
View file @
3a5f04a8
...
...
@@ -63,6 +63,19 @@ gridItems.forEach(function(item)
formItem
.
querySelector
(
"
input[id$=prix]
"
).
value
=
prix
;
});
// lorsqu'on relâche la souris
// recalcule le total
let
spanTotal
=
document
.
querySelector
(
"
span#total
"
);
input
.
addEventListener
(
'
mouseup
'
,
function
()
{
let
total
=
0
;
for
(
let
formItem
of
formItems
)
{
total
=
total
+
parseFloat
(
formItem
.
querySelector
(
"
input[id$=prix]
"
).
value
);
}
spanTotal
.
textContent
=
total
.
toFixed
(
2
);
});
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment