salve,
bellissimo topic complimenti mi è di grandissima utilità,
mi permetto di postare su questo topic di qualche anno fa, ho creato la mia preventivazione tipografica per libri digitali, ho strutturato il form in due parti, uno riguardante il calcolo dell'interno del libro e uno della copertina poi peri il costo totale ho creato una formula che addiziona il costo dell'interno con il costo della coperta, il problema è che non mi fa l'addizione per il costo totale.
questo è il codice da me creato...........dove sbaglio??
html
<h2>struttura del libro</h2>
[br /]
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Formato del libro</label>
<select class="cf_inputbox validate-selection" id="select_1" size="1" title="" name="formato" onChange="updatethis(this.form);">
<option value="">Seleziona</option>
<option value="200"> 17x24</option>
<option value="315">21x30</option>
</select>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Tipo di carta</label>
<select class="cf_inputbox validate-selection" id="select_2" size="1" title="" name="carta" onChange="updatethis(this.form);">
<option value="">Seleziona</option>
<option value="0.00001">Lucida (80g)</option>
<option value="0.00002">Opaca (160g)</option>
</select>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Numero delle pagine</label>
<input class="cf_inputbox required validate-number" maxlength="10" size="10" title="" id="text_0" name="pagine" type="text" onChange="updatethis(this.form);" value=""/>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Colori di stampa</label>
<select class="cf_inputbox validate-selection" id="select_3" size="1" title="" name="colori" onChange="updatethis(this.form);">
<option value="">Seleziona</option>
<option value="0.05">bianco e nero</option>
<option value="0.09">colori</option>
</select>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Numero delle copie</label>
<input class="cf_inputbox required validate-number" maxlength="10" size="10" title="" id="text_1" name="copie" type="text" onChange="updatethis(this.form);" value=""/>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Costo interno</label>
<input class="cf_inputbox" maxlength="10" size="10" title="" id="text_100" name="totaleinterno" type="text" value="0" readonly="readonly"/>
<>
<div class="cfclear"> <>
<>
[br /][br /]
<h2>struttura dela copertina</h2>
[br /]
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Formato dela copertina</label>
<select class="cf_inputbox validate-selection" id="select_4" size="1" title="" name="formatocoperta" onChange="updatethis(this.form);">
<option value="">Seleziona</option>
<option value="400">17x24</option>
<option value="620">21x30</option>
</select>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Tipo di carta</label>
<select class="cf_inputbox validate-selection" id="select_5" size="1" title="" name="cartacoperta" onChange="updatethis(this.form);">
<option value="">Seleziona</option>
<option value="0.00004">Lucida (320g)</option>
<option value="0.00004">Opaca (320g)</option>
</select>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Numero delle pagine stampate</label>
<input class="cf_inputbox required validate-number" maxlength="10" size="10" title="" id="text_2" name="paginecoperta" type="text" onChange="updatethis(this.form);" value=""/>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Colori di stampa</label>
<select class="cf_inputbox validate-selection" id="select_6" size="1" title="" name="coloricoperta" onChange="updatethis(this.form);">
<option value="">Seleziona</option>
<option value="0.05">bianco e nero</option>
<option value="0.09">colori</option>
</select>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Costo copertina</label>
<input class="cf_inputbox" maxlength="10" size="10" title="" id="text_101" name="totalecoperta" type="text" value="0" readonly="readonly"/>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Costo totale</label>
<input class="cf_inputbox" maxlength="10" size="10" title="" id="text_102" name="totale" type="text" value="0" readonly="readonly"/>
<>
<div class="cfclear"> <>
<>
<div class="form_item">
<div class="form_element cf_button">
<input value="Invia" name="button_3" type="submit" /><input type="reset" name="reset" value="Reset"/>
<>
<div class="cfclear"> <>
<>
java
function updatethis(form) {
form.elements['totaleinterno'].value = form.elements['formato'].value
* form.elements['carta'].value * form.elements['pagine'].value
* form.elements['colori'].value
* form.elements['copie'].value;
form.elements['totalecoperta'].value = form.elements['formatocoperta'].value
* form.elements['cartacoperta'].value * form.elements['paginecoperta'].value
* form.elements['coloricoperta'].value
* form.elements['copie'].value;
form.elements['totale'].value = form.elements['totaleinterno'].value
+ form.elements['totalecoperta'].value;
}