Hello everybody,

I tried some jQuery AJAX tutorials and got started with jQuery. Moving
further, I got stuck somewhere in my code and I don't know, why. What
I wanna do is simple: give an email address to a php script and
display the script's answer in my page without reloading. so this is
what i wrote:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function()
        {
        $("#newsletteranmeldung").submit(function()
                {
                $.post("newsletter.php",{email: $("#email).val() 
$("aktion").val()},
function(){$("#ausgabe").load("newsletter.php")}); return false;
                });
        });
</script>


<form action="" method="post" id="newsletteranmeldung">
<div id="ausgabe"><p>&nbsp;</p></div>
<table>

<tr>
<td style="padding-right: 15px;">E-Mail:</td>
<td><input name="email" size="35" maxlength="30" /></td>
</tr>

<tr>
<td></td>
<td>
<select id="aktion">
<option value="0">in den Newsletter eintragen</option>
<option value="1">Newsletter abbestellen</option>
</select>
</td>
</tr>

<tr>
<td></td>
<td><input type="submit" value="Go!" id="los" /></td>
</tr>
</table>
</form>

Reply via email to