I have a problem with jQuery load() and html forms. After loading a div from a php. file into a div, the form doesn't work anymore:
jquery:
<script>
$(document).ready(function (){
$("#buttest").click(function (){
$("#ajax").load("Vokabeltrainer_sec.php?Lektion=<?php echo $lection ?> #area");
});
});
</script>
HTML-Form:
<?php
echo '<form action="Ergebnis.php" method="post">';
generateRadio($translation, $firstWord, $i, $index, $lection);
echo '<form>';
?>
The .php function is generating radio buttons. Before reloading the div evrything works fine! Of course there is also a submit-botton:
<button type="submit" name="submit" value="Submit" id="subbut" class="btn btn-default">weiter</button>
Sorry for my bad english!
EDIT:
<div id="ajax">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Übersetzung auswählen</h3>
</div>
<div class="panel-body">
<?php
echo '<form action="Ergebnis.php" method="post">';
generateRadio($translation, $firstWord, $i, $index, $lection);
echo '<form>';
?>
</div>
</div>
<br>
<button type="submit" name="submit" value="Submit" id="subbut" class="btn btn-default">weiter</button>
<div id="test">
<button type="button" id="buttest">TEST</button>
</div>
</div>
</div>
The div with id="ajax" should be reloaded whith nearly the same div but with a different php function.