C O N O S C E N Z A
web data management
Il nostro è un team che si occupa ormai da piu' di un decennio della risoluzione delle problematiche informatiche, in particolare ci piace poter offrire la nostra competenza in ambito telematico, dalla progettazione su misura della vostra infrastruttura web, alla realizzazione del vostro software e dei vostri portali.
Web

javascript dinamic total by php

21/09/2008
    Example for auto insert form field  by php    

 

echo " <script language=\"javascript\" type=\"text/javascript\">
function tot(value)
{
    
     var totale = document.getElementById('total');
      var price = document.getElementById('price');
      var quantity = document.getElementById('quantity');

 
     total.value = price.value * quantity.value;  
}
   </script>

<form>
<input type=text id=\"price\"  name=\"price\" value=\"\" onchange=\"tot(this.value)\">
<input type=text id=\"quantity\"  name=\"quantity\" value=\"\" onchange=\"tot(this.value)\">
<input type=text id=\"total\"  name=\"total\" value=\"\" readonly>
<input type=\"button\" name=\"recalculate\" value=\"recalculate\" onclick=\"tot()\">
<input type=submit name=action value=Insert>
</form>
";