index.php
<script type="text/javascript"> function $(id){ return document.getElementById(id); } advAJAX.assign( $("the_form"), { onLoading : function(obj){ $('suma').value = 'wait...'; }, onSuccess : function(obj) { $('suma').value =obj.responseText; } }); </script> <form action="oblicz.php" id="the_form" method="post"> <input type="text" name="skladnik1" value="">+ <input type="text" name="skladnik2" value=""> <input type="submit" value="="> <input type="text" id="suma" value="" readonly> </form>
skrypt oblicz.php
<?php $suma = $_REQUEST['skladnik1'] + $_REQUEST['skladnik2']; ?>
jest to prosty przykład ilustrujący mój problem.
Otóż chce wywołać formularz i jego wynik wyświetlić na tej samej stronie. Czytałem i próbowałem advAjax.assign(), ale za każdym razem przeładowywuje mi całą stronę...
Jaki robię błąd?