How can i dynamically display javascript content

Multi tool use
I am very new to javascript. My goal is to convert my excel sheet into javascript. I want to forecast preventive maintenance and display running hours and maintenance kits. if somebody could point me in the right direction would be appreciated.
I am calculating: daily running hours (max. 24 hours) multiplied by years(max 5 years). The result = total running hours. I want to display the running hours and kits dynamically. For better understanding of my goal, please see
below screenshot from my excel sheet.. I also included a screenshot of the maintenance hours as the maintenance kits are repeated on certain hours.
I prepared a fiddle where i started with the simple hour calculation.
How can i display the maintenance hours and kits dynamically depending on total hours?
$(document).ready(function() {
$(".calculate").click(function() {
var d = $('input[name="duty"]').val();
var y = $('input[name="year"]').val();
var total = d * y * 365;
$('.result').val(total);
var a1 = 1000;
var ab1 = 2000;
var abc1 = 4000;
var abcd1 = 16000;
var abcde1 = 32000;
});
});
I just would need a pointer in the right direction please.
Best regards
Pascal
javascript jquery
add a comment |
I am very new to javascript. My goal is to convert my excel sheet into javascript. I want to forecast preventive maintenance and display running hours and maintenance kits. if somebody could point me in the right direction would be appreciated.
I am calculating: daily running hours (max. 24 hours) multiplied by years(max 5 years). The result = total running hours. I want to display the running hours and kits dynamically. For better understanding of my goal, please see
below screenshot from my excel sheet.. I also included a screenshot of the maintenance hours as the maintenance kits are repeated on certain hours.
I prepared a fiddle where i started with the simple hour calculation.
How can i display the maintenance hours and kits dynamically depending on total hours?
$(document).ready(function() {
$(".calculate").click(function() {
var d = $('input[name="duty"]').val();
var y = $('input[name="year"]').val();
var total = d * y * 365;
$('.result').val(total);
var a1 = 1000;
var ab1 = 2000;
var abc1 = 4000;
var abcd1 = 16000;
var abcde1 = 32000;
});
});
I just would need a pointer in the right direction please.
Best regards
Pascal
javascript jquery
Java or JavaScript?
– H77
Dec 28 '18 at 3:25
i am sorry i guess it should be java only.
– Pascal Westrich
Dec 28 '18 at 3:30
1
From your question it looks as though you mean Javascript, not Java -- are you wanting your spreadsheet replacement to run in a web browser?
– tgdavies
Dec 28 '18 at 3:43
I don't want to replace it. i want to display the hours and maintenance kits as in the spreadsheet. in excel for example to display the 1000 hours i did =IF($J$12>=1000,1000,"") J12 in this case is the total hours to display the kit i did in excel =IF(C17=1000,B3,"") and C17 is the 1000 and B3 is the a1 kit. i did found a page where i can convert excel formulas to js but i don't know how to display it
– Pascal Westrich
Dec 28 '18 at 5:10
add a comment |
I am very new to javascript. My goal is to convert my excel sheet into javascript. I want to forecast preventive maintenance and display running hours and maintenance kits. if somebody could point me in the right direction would be appreciated.
I am calculating: daily running hours (max. 24 hours) multiplied by years(max 5 years). The result = total running hours. I want to display the running hours and kits dynamically. For better understanding of my goal, please see
below screenshot from my excel sheet.. I also included a screenshot of the maintenance hours as the maintenance kits are repeated on certain hours.
I prepared a fiddle where i started with the simple hour calculation.
How can i display the maintenance hours and kits dynamically depending on total hours?
$(document).ready(function() {
$(".calculate").click(function() {
var d = $('input[name="duty"]').val();
var y = $('input[name="year"]').val();
var total = d * y * 365;
$('.result').val(total);
var a1 = 1000;
var ab1 = 2000;
var abc1 = 4000;
var abcd1 = 16000;
var abcde1 = 32000;
});
});
I just would need a pointer in the right direction please.
Best regards
Pascal
javascript jquery
I am very new to javascript. My goal is to convert my excel sheet into javascript. I want to forecast preventive maintenance and display running hours and maintenance kits. if somebody could point me in the right direction would be appreciated.
I am calculating: daily running hours (max. 24 hours) multiplied by years(max 5 years). The result = total running hours. I want to display the running hours and kits dynamically. For better understanding of my goal, please see
below screenshot from my excel sheet.. I also included a screenshot of the maintenance hours as the maintenance kits are repeated on certain hours.
I prepared a fiddle where i started with the simple hour calculation.
How can i display the maintenance hours and kits dynamically depending on total hours?
$(document).ready(function() {
$(".calculate").click(function() {
var d = $('input[name="duty"]').val();
var y = $('input[name="year"]').val();
var total = d * y * 365;
$('.result').val(total);
var a1 = 1000;
var ab1 = 2000;
var abc1 = 4000;
var abcd1 = 16000;
var abcde1 = 32000;
});
});
I just would need a pointer in the right direction please.
Best regards
Pascal
javascript jquery
javascript jquery
edited Dec 28 '18 at 5:14
Nosrep
6913
6913
asked Dec 28 '18 at 3:23
Pascal Westrich
65
65
Java or JavaScript?
– H77
Dec 28 '18 at 3:25
i am sorry i guess it should be java only.
– Pascal Westrich
Dec 28 '18 at 3:30
1
From your question it looks as though you mean Javascript, not Java -- are you wanting your spreadsheet replacement to run in a web browser?
– tgdavies
Dec 28 '18 at 3:43
I don't want to replace it. i want to display the hours and maintenance kits as in the spreadsheet. in excel for example to display the 1000 hours i did =IF($J$12>=1000,1000,"") J12 in this case is the total hours to display the kit i did in excel =IF(C17=1000,B3,"") and C17 is the 1000 and B3 is the a1 kit. i did found a page where i can convert excel formulas to js but i don't know how to display it
– Pascal Westrich
Dec 28 '18 at 5:10
add a comment |
Java or JavaScript?
– H77
Dec 28 '18 at 3:25
i am sorry i guess it should be java only.
– Pascal Westrich
Dec 28 '18 at 3:30
1
From your question it looks as though you mean Javascript, not Java -- are you wanting your spreadsheet replacement to run in a web browser?
– tgdavies
Dec 28 '18 at 3:43
I don't want to replace it. i want to display the hours and maintenance kits as in the spreadsheet. in excel for example to display the 1000 hours i did =IF($J$12>=1000,1000,"") J12 in this case is the total hours to display the kit i did in excel =IF(C17=1000,B3,"") and C17 is the 1000 and B3 is the a1 kit. i did found a page where i can convert excel formulas to js but i don't know how to display it
– Pascal Westrich
Dec 28 '18 at 5:10
Java or JavaScript?
– H77
Dec 28 '18 at 3:25
Java or JavaScript?
– H77
Dec 28 '18 at 3:25
i am sorry i guess it should be java only.
– Pascal Westrich
Dec 28 '18 at 3:30
i am sorry i guess it should be java only.
– Pascal Westrich
Dec 28 '18 at 3:30
1
1
From your question it looks as though you mean Javascript, not Java -- are you wanting your spreadsheet replacement to run in a web browser?
– tgdavies
Dec 28 '18 at 3:43
From your question it looks as though you mean Javascript, not Java -- are you wanting your spreadsheet replacement to run in a web browser?
– tgdavies
Dec 28 '18 at 3:43
I don't want to replace it. i want to display the hours and maintenance kits as in the spreadsheet. in excel for example to display the 1000 hours i did =IF($J$12>=1000,1000,"") J12 in this case is the total hours to display the kit i did in excel =IF(C17=1000,B3,"") and C17 is the 1000 and B3 is the a1 kit. i did found a page where i can convert excel formulas to js but i don't know how to display it
– Pascal Westrich
Dec 28 '18 at 5:10
I don't want to replace it. i want to display the hours and maintenance kits as in the spreadsheet. in excel for example to display the 1000 hours i did =IF($J$12>=1000,1000,"") J12 in this case is the total hours to display the kit i did in excel =IF(C17=1000,B3,"") and C17 is the 1000 and B3 is the a1 kit. i did found a page where i can convert excel formulas to js but i don't know how to display it
– Pascal Westrich
Dec 28 '18 at 5:10
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953324%2fhow-can-i-dynamically-display-javascript-content%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953324%2fhow-can-i-dynamically-display-javascript-content%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
fVLNRajqFnl s21IxzkA Lx,yZ14nOF,t8FXuoZ0XShp95,jLJN h rc3pJiOC
Java or JavaScript?
– H77
Dec 28 '18 at 3:25
i am sorry i guess it should be java only.
– Pascal Westrich
Dec 28 '18 at 3:30
1
From your question it looks as though you mean Javascript, not Java -- are you wanting your spreadsheet replacement to run in a web browser?
– tgdavies
Dec 28 '18 at 3:43
I don't want to replace it. i want to display the hours and maintenance kits as in the spreadsheet. in excel for example to display the 1000 hours i did =IF($J$12>=1000,1000,"") J12 in this case is the total hours to display the kit i did in excel =IF(C17=1000,B3,"") and C17 is the 1000 and B3 is the a1 kit. i did found a page where i can convert excel formulas to js but i don't know how to display it
– Pascal Westrich
Dec 28 '18 at 5:10