haardys Posted January 10, 2011 Report Share Posted January 10, 2011 Nepieciešama tāda fīča - input laukā ievada skaitli, konkrēti preces cenu, un tur pat blakus uzreiz izrēķina preces cenu ar PVN. Man tas viss izdodas tikai ar sumbit palīdzību, bet būtu idāli, ja jau uzreiz tiktu izrēķināts, lai nebūtu jāspiež submit! Link to comment Share on other sites More sharing options...
rATRIJS Posted January 10, 2011 Report Share Posted January 10, 2011 Izmanto JavaScript tā paveikšanai. Link to comment Share on other sites More sharing options...
Blitz Posted January 10, 2011 Report Share Posted January 10, 2011 (edited) tad javascript: HTML: <input type="text" name="price" id="price" value="" onchange="calculate_wat();" /> <input type="text" name="price_full" id="price_full" value="" /> JS: document.onload(calculate_wat()); function calculate_wat() { var price=document.getElementById('price').value; var wat=22; document.getElementById('price_full').value=price+price*wat/100; } Edited January 10, 2011 by Blitz Link to comment Share on other sites More sharing options...
haardys Posted January 10, 2011 Author Report Share Posted January 10, 2011 O, liels paldies! Link to comment Share on other sites More sharing options...
php newbie Posted January 10, 2011 Report Share Posted January 10, 2011 tikai VAT rakstas ar V ;) Link to comment Share on other sites More sharing options...
Blitz Posted January 10, 2011 Report Share Posted January 10, 2011 p0k3 stilā ar w :) Link to comment Share on other sites More sharing options...
daGrevis Posted January 10, 2011 Report Share Posted January 10, 2011 p0k3 stilā ar w :) Sasmīdināji! =D =] Link to comment Share on other sites More sharing options...
Kemito Posted January 10, 2011 Report Share Posted January 10, 2011 Tad jau angļu valodā, kur tiek izmantots dubultais V burts tobish W, sanāk ka viņi ir "pok3moni" muahahahhaa ! Link to comment Share on other sites More sharing options...
Blitz Posted January 10, 2011 Report Share Posted January 10, 2011 tak vienakrshi izdomaju stulbu attaisnojumu savam misspellingam, ej dabu kautkur humora izjutu... Link to comment Share on other sites More sharing options...
daGrevis Posted January 10, 2011 Report Share Posted January 10, 2011 Nu nez, nevajag jau uzreiz "aizsvilties"! =D Man tas likās smieklīgi, Blitz! =P Link to comment Share on other sites More sharing options...
marcis Posted January 10, 2011 Report Share Posted January 10, 2011 > "100"+"100"*22/100 >> "10022" Vārdu sakot tur vēl parseFloat() derētu ;) Link to comment Share on other sites More sharing options...
Recommended Posts