Back to myContactForm.com - Easy email form creation and processing for your web site
myContactForm.com - Help Forum Forum Index myContactForm.com - Help Forum
Have a question that you need answered about myContactForm.com? Post it on this message board but first search this forum and read out FAQ to ensure it has not already been answered. This is not a board to post links to your site! SPAM will be deleted!
 
   Search MessagesSearch Messages
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hey! I need to add total price on my code.

 
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Form Management
View previous topic :: View next topic  
Author Message
laumbert



Joined: 18 Oct 2016
Posts: 1

PostPosted: Wed Oct 11, 2017 2:06 am    Post subject: Hey! I need to add total price on my code. Reply with quote

<label for="q9" style="float: left; width: 30%; padding-top: 4px; font-family: Arial; color: #000000; font-size: 14px;"
>Applikasjon 1: </label> <select name="q9" id="q9" id="data-price1" style="font-family: Arial; font-size: 14px; color: #000000; background-color: #FFFFFF; border: 1px solid #000000; padding: 2px;">


<option value="Hosting - Visma Lønn">Hosting - Visma Lønn</option>
<option value="Hosting - Visma Global">Hosting - Visma Global</option>

i can get the total price if i change the value, but then the price show up on the email, not the name of the choise.

can someone help me to add the price of the difrent options and get the total price and send it on the email aswell?


This is something i coded, here it adds the price but this cant be used to send the email. i need two values in one option.
U can see the price in the option value under here

<p>
 
Hosted Services Type:
<div class="contentcontainer med left" style="margin-left: 350px;position: relative;
bottom: 35px;">
<select id="selectedServerCount" name="Hosted Services Type" onClick="updateSelected()">
    <option value="0">Velg tilgang </option>
    <option value="100">1 Azure  </option>
    <option value="200">2 Applikasjon </option>
    <option value="300">3 Online </option>
</select>
</p>
</div class>
 
 
<p>
<span id="showSelectedServerCount"></span>
</p>
 
<script type="text/javascript">
   
    function updateSelected() {
        var antServers = document.getElementById("selectedServerCount");
        var selectedAntServers = antServers.options[antServers.selectedIndex].value;
        var showSelectedServerCount = document.getElementById("showSelectedServerCount");
       
        showSelectedServerCount.innerHTML = "Pris: " + selectedAntServers + " NOK";
    }
 
 
    </script>


<p>Summen blir:</p>
<button onclick="sum()">Trykk for totalsum</button>
<p id="demo2">Totalsummen: </p>
 
<script type="text/javascript">
 
    function sum()
    {
        var fn, ln, sn, tn, result;
        fn = parseInt(document.getElementById("selectedServerCount").value, 10);
        ln = parseInt(document.getElementById("selectedServerCount2").value, 10);
        sn = parseInt(document.getElementById("selectedServerCount3").value, 10);
        tn = parseInt(document.getElementById("selectedServerCount3").value, 10);
        result =  (fn+ln+sn+tn);
        document.getElementById("demo2").innerHTML = "Totalsummen blir: " + result + " NOK";
       
        //result =  (parseFloat(fn)+parseFloat(ln));
       
       
    }
 
    </script>
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Form Management All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group