I am working a contact form that needs to do 2 things when selected from drop down show checkboxes when all the informatie is selected it need to show a the total price lets say they schoose 20,- from drop down and 5,- and 10,- from the checkboxes then it needs to show the total of 35 if they want they can send this info as a mail to us.
Posted the script on fiddle in the hope someone can help me to compleet it.
<form method="post" action="?p=send">
<label for="dropdown">Selecteer pakket</label>
<select id="dropdown" name="dropdown" >
<option value="" disabled="disabled" selected="selected">maak uw eerste keuze</option>
<option value="1"> Option1 = €20,-</option>
<option value="2"> Option1 = €30,-</option>
<option value="3"> Option1 = €40,-</option>
<option value="4"> Option1 = €50,-</option>
</select>
<div id='checkbox'>
<br>
Extra:
<div data-id="1">
<label for="id_checkbox_0"><input id="id_checkbox_0" name="checkbox"type="checkbox" value="1" /> extra1 = €15,-</label><br>
<label for="id_checkbox_1"><input id="id_checkbox_1" name="checkbox" type="checkbox" value="2" /> extra2 = €25,-</label><br>
<label for="id_checkbox_2"><input id="id_checkbox_2" name="checkbox" type="checkbox" value="3" /> extra4 = €35,-</label>
</div>
<div data-id="2">
<label for="id_checkbox_1"><input id="id_checkbox_1" name="checkbox" type="checkbox" value="2" />extra1 = €30,-</label><br>
<label for="id_checkbox_2"><input id="id_checkbox_2" name="checkbox" type="checkbox" value="3" /> extra2 = €40,-</label>
<label for="id_checkbox_3"><input id="id_checkbox_3" name="checkbox" type="checkbox" value="4" /> extra3 = €10,-</label>
</div>
<div data-id="3">
<label for="id_checkbox_2"><input id="id_checkbox_2" name="checkbox" type="checkbox" value="3" /> extra1 = €12,-</label><br>
<label for="id_checkbox_1"><input id="id_checkbox_1" name="checkbox" type="checkbox" value="2" /> extra2 = €10,-</label>
</div>
<div data-id="4">
<label for="id_checkbox_2"><input id="id_checkbox_2" name="checkbox" type="checkbox" value="3" /> extra1 = €60,-</label><br>
<label for="id_checkbox_3"><input id="id_checkbox_3" name="checkbox" type="checkbox" value="4" /> extra = €35,-</label>
</div>
</div>
<ul>
<li>Je voornaam *</li>
<li><input type="text" name="voornaam" /></li>
<li>Je achternaam *</li>
<li><input type="text" name="achternaam" /></li>
<li>Je e-mail adres *</li>
<li><input type="text" name="email" /></li>
<li>Je berichtje *</li>
<li><textarea cols="50" rows="12" name="bericht"></textarea></li>
<li><input type="reset" value="Begin opnieuw" /> <input type="submit" name="versturen" value="Verstuur bericht" /></li>
</ul>
<p>Alle velden gemarkeerd met een * zijn verplicht.</p>
</form>
Aucun commentaire:
Enregistrer un commentaire