php - pass a dynamically created table on submit -


i building simple application allow users add rows table , generate table user can type in data rows , columns.

so far have managed create rows dynamically jsfiddle

now need when user hits generate (i using php this), table must shown in html text area.

i did try below code didn't work

<form action="1.php" method="post"> <?php  echo $table = '<table id="maintable" width="50%" cellpadding="0" cellspacing="0" class="pdzn_tbl1" border="#729111 1px solid" > <tr><td colspan=3>sdsdsdsds</td></tr> <tr><td colspan=1>fsdfsf</td><td colspan=2>sdffsdfsf</td></tr> </table>';?>  <textarea name="thetable" style="display:none"><?php echo $table ?></textarea>  <input type="button" name="add" value="add 1 column" id="addrows1" style="color:#3300ff; font-size:16px; " />  <input type="submit" name="gen" value="generate table"  style="color:#3300ff; font-size:16px; " /> </form>  <?php  if(isset($_post['gen'])) { var_dump($_post['thetable']);    }  ?> 

any on how can fix this?

from yous jsfiddel, i've add <input> in code.

$('#maintable tr:last').after('<tr><td><input type="text" /></td><td><input type="text" /></td><td><input type="text" /></td></tr>'); 

why didn't try add <input>? hope you


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -