| | |
Generating Fields On the Fly
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
hello..
try this code:
and also check:
http://www.daniweb.com/forums/thread135356.html
try this code:
html Syntax (Toggle Plain Text)
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Third Santor</title> <script> function generate(){ var myDiv = document.getElementById('someid'); var objTextArea = document.getElementById('mem1'); var list = objTextArea.value.split('\n'); var tbody = document.createElement('tbody'); for(var i=0; i<list.length; i++){ var cell1 = document.createElement('td'); var label = document.createTextNode(list[i]); cell1.appendChild(label); var cell2 = document.createElement('td'); var textbox = document.createElement('input'); textbox.type = 'text'; textbox.id = list[i]; cell1.appendChild(textbox); var row = document.createElement('tr'); row.appendChild(cell1); row.appendChild(cell2); tbody.appendChild(row); } var table = document.createElement('table'); table.border = 1; table.appendChild(tbody); /* var submit = document.createElement('input'); submit.type = 'submit'; submit.value = 'Submit'; */ myDiv.appendChild(table); myDiv.appendChild(submit); } </script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> <form name="frm1" method="post" action="" onsubmit="return "> <textarea name="mem1" id="mem1" rows="10" cols="30"></textarea> <input type="button" value="Generate" onclick="generate();"> </form> <DIV id="someid"></DIV> </body> </html>
http://www.daniweb.com/forums/thread135356.html
Last edited by Shanti Chepuru; Oct 8th, 2008 at 10:20 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
![]() |
Other Threads in the PHP Forum
- Previous Thread: Multiple files Upload plz HelP
- Next Thread: Need the help of a programer
| Thread Tools | Search this Thread |
apache api array basic beginner binary body broken cakephp class cms code computing confirm cron curl customizableitems database date date/time delete display dynamic echo email error file files filter folder form forms forum function functions gc_maxlifetime global google headmethod href htaccess html iframe image include ip javascript joomla limit link list login malfunction memmory memory menu mlm msqli_multi_query multiple mycodeisbad mysql navigation oop parameter parsing paypal pdf php phpmysql query question random recourse recursion regex script search select seo server sessions snippet source space sql static system table thesishelp trouble tutorial update upload url variable video web webdesign xml youtube






