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

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -