php - JavaScript generated form input not working -
i generating form javascript , php radio inputs don't work. i'm clicking radio button , isn't checking. wrong in code?
function showmenu() { ... xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("game").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","getgamemenu.php",true); xmlhttp.send(); } here echo getgamemenu.php:
<?php echo '<form id="menugame" action="getgame.php" method="post" onsubmit="showgame(); return false;"> <div id = "bigdiv"> <div class="divs"> <label>select dificulty</label> <div> <input type="radio" id="easy" name="dificulty"/> <label for="easy">easy</label> </div> ... </div> <input type="submit" class="buton" id="butplay" value="play"> </form>'; ?> i found out problem css style. had position:relative , put position:absolute , works.
remove return false onsubmit event of form. should below.
<form id="menugame" action="getgame.php" method="post" onsubmit="showgame();"> also make sure method showgame() not return false. form submitted successfully.
Comments
Post a Comment