| | |
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 beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






