Hello Madona33 welcome to WW
Let me start with the post title:
adobe/javascript
I'm not sure why you refer to adobe, but if you mean adobe Flash, then you should know that there is no longer any support for Flash in modern browsers, nor from Adobe itself. You should not use it all even in legacy code, it is a big security risk and most users will not be able use it.
What you are asking for is not a simple script and to be done correctly requires both client side (javascript) and server side code. I can provide you with a few pointers to get you started but
I would need help to create a date and total calculation in an order form, I am really very new in this field
Being that you are beginner this may be challenging for you.
1- This is relatively straight forward. Use the JS Date() API , convet both inputs into "Date" objects and then subtract the value to get the number of days. See this link for more details and examples:
[
developer.mozilla.org...]
Note once you have the number of days difference the rest because simple math.
2- Again this is straight forward, add <div> on your page with the notification, eg "20% Surcharge in Effect" give it an id say "notification" and class of say "hide-notification" and using CSS set the style for that class to display:none, then set a style for a second class called "show-notification" with the style display:block. This will hide the div by default. Then use an if statement in your JS code, if the days calculated in 1 is greater 20 days change the class name to "show-notification".
// change class to show-notification
document.querySelector('#notification').className = "show-notification"
4 - To stop the script from running
I'm not sure what you mean by this. If this is a web page, then the script runs when the user access the page, and/or when the user submits the form. It is for all intents and purposes instant, there shouldn't be a time lag (network latency and other such things are negligible in this case). When the form is submitted, it should simply have a boolean (yes/no) field "apply surcharge" yes or no. As to how you handle the form once you receive on your end, that is a completely different issue. There must be two separate mechanism in place one for the user (described above) and another for you to manage. Handling the management side is a completely different thing. It can also work with "client-side" Javascript but now the client is you. Regardless this will require that your server receive the user's form, process it and then delegate it to next step, put it in a queue, send it by email, whatever. This process is outside of the scope of a Javascript script, it will need to be run on the server in whatever code your server is running (PHP, Python, NodeJS etc...)
I hope this helps.