/    Sign up×
Community /Pin to ProfileBookmark

Sum dynamical input fields with Jquery

I want to calculate input fields value and and show in total input by using jquery ? can you please suggest how to do this ? Here is my code

[code]<div class=”control-group”>
<div align=”right” style=”margin-right:50px; margin-top:20px;”><button type=”button” id=”addmore” class=”btn btn-info”>Add More</button></div>
<label class=”control-label”>Fee :</label>
<div class=”translations”>
<div class=”controls”>
<input type=”text” class=”span6″ name=”feelist[]” id=”feelist” placeholder=”Fee List” />
<input type=”text” class=”span6″ name=”fee[]” id=”fee” placeholder=”Enter Fee in Number” />
</div>
</div>
</div>
<div class=”control-group”>
<label class=”control-label”>Discount / Total Paid:</label>
<div class=”controls”>
<input type=”text” class=”span6″ name=”fee_discount” id=”fee_discount” placeholder=”Fee Discount…” />
<input type=”text” class=”span6″ name=”fee_paid” id=”fee_paid” placeholder=”Total Fee Paid…” /></div>

<script type=”text/javascript”>
$(‘#addmore’).click(function(){
var fieldHTML = ‘<div class=”controls”><input type=”text” class=”span6″ name=”feelist[]” placeholder=”Fee List” value=”” autocomplete=”off” /><input type=”text” class=”span6″ name=”fee[]” placeholder=”Add Fee in Number” value=”” autocomplete=”off” /><span class=”remove” style=”margin:20px;”><i class=”icon-trash” style=”font-size:20px;”></i></span></div>’;
$(‘.translations’).append(fieldHTML);
}); </script>[/code]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 01.2020 — Added ... tags to your post.
Copy linkTweet thisAlerts:
@NogDogMay 01.2020 — [[17,19],[2,4,52]]
Copy linkTweet thisAlerts:
@jasmine381authorMay 02.2020 — @NogDog#1618033 --any solution ??
Copy linkTweet thisAlerts:
@NogDogMay 02.2020 — @jasmine381#1618040

Nope, I'm not a JavaScript guru.
×

Success!

Help @jasmine381 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...