Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
- </head>
- <body>
- <input type="radio" id='smartphone' name="type" value="smartphone"> Smartphone
- <input type="radio" id='basic' name="type" value="basic"> Basic
- <input type="radio" id='connected' name="type" value="connected"> Connected
- <input type="radio" id='watch'name="type" value="watch" > Watch
- <input id='dpMax' type="text" class="form-control formBlock" placeholder="DP Max..." required/>
- <input id='cost' type="text" class="form-control formBlock" placeholder="Cost..." required/>
- <input id='fee' type="hidden" class="form-control formBlock" placeholder="5% Fee... (DP Max x .05)" required/>
- <input id='rqComm' type="hidden" class="form-control formBlock" value="130" placeholder="RQ Commisson..." required/>
- <br />
- Total GP: <span id="total_gp" style="color:red;font-weight:bold"></span>
- </body>
- <script>
- $('input').keyup(function(){
- var dpMax = Number($('#dpMax').val());
- var cost = Number($('#cost').val());
- var fee = Number($('#fee').val());
- var rqComm = Number($('#rqComm').val());
- var rqConnComm = 90;
- var rqBasicComm = 60;
- var rqWatchComm = 40;
- // Smartphones //
- if ( $("#smartphone").is(':checked') == true ) {
- if ((dpMax * '.05')>=50){
- $('#total_gp').html(dpMax - cost - '50.00' + rqComm);
- }
- else{
- $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqComm);
- }
- }
- // Connected //
- else if ( $("#connected").is(':checked') == true ) {
- if ((dpMax * '.05')>=50){
- $('#total_gp').html(dpMax - cost - '50.00' + rqConnComm);
- }
- else{
- $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqConnComm);
- }
- }
- // Watches //
- else if ( $("#watch").is(':checked') == true ) {
- if ((dpMax * '.05')>=50){
- $('#total_gp').html(dpMax - cost - '50.00' + rqWatchComm);
- }
- else{
- $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqWatchComm);
- }
- }
- // basic //
- else if ( $("#basic").is(':checked') == true ) {
- if ((dpMax * '.05')>=50){
- $('#total_gp').html(dpMax - cost - '50.00' + rqBasicComm);
- }
- else{
- $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqBasicComm);
- }
- }
- });
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement