| | |
problem to create input text continiously?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 296
Reputation:
Solved Threads: 11
Hi,
I am writing code to create new text filed dynamically.
But after create 2 or 3 it stops.
Not creating continuously.
How to solve this??
I am writing code to create new text filed dynamically.
But after create 2 or 3 it stops.
Not creating continuously.
How to solve this??
PHP Syntax (Toggle Plain Text)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <SCRIPT language="javascript"> function GenerateRow(rowid){ str = '<tr>'; str = str + '<td width="7" align="left" valign="top"><img src="images/cor-topLeft.gif" width="7" height="6" alt=""/></td>'; str = str + '<td width="894"></td>'; str = str + '<td width="8" align="right" valign="top"><img src="images/cor-topRight.gif" width="7" height="6" alt=""/></td>'; str = str + '</tr>'; str = str + '<tr>'; str = str + ' <td></td>'; str = str + ' <td class="formText">'; str = str + ' <input name="textfield10" type="text" class="inputText" id="textfield10" size="20" />'; str = str + ' @yourdomain.com points to'; str = str + ' <select name="select3" class="dropDown" id="select3">'; str = str + ' <option>Select</option>'; str = str + ' <option selected="selected">miles</option>'; str = str + ' </select>@yourdomain.com</td>'; str = str + '<td></td>'; str = str + '</tr>'; str = str + '<tr>'; str = str + ' <td align="left" valign="bottom"><img src="images/cor-botLeft.gif" width="7" height="6" alt=""/></td>'; str = str + ' <td></td>'; str = str + ' <td align="right" valign="bottom"><img src="images/cor-botRight.gif" width="7" height="6" alt=""/></td>'; str = str + ' </tr>'; return str; } function AddLastRow(){ var htm = document.getElementById("service_table").innerHTML; var tbl = '<table border="0" cellpadding="0" cellspacing="0" bgcolor="#d2e8fd" width="909" id="tbl1">'; var tbl; var tbl2=""; if(htm ==""){ tbl2 = tbl2 + GenerateRow(1); } else{ tbl2 = ""; var obj = document.getElementById("tbl1") var trobj = obj.getElementsByTagName("tr"); for(i=0;i<trobj.length;i++) { tbl2 = tbl2 + "<tr bgcolor='#d2e8fd'>" tbl2 = tbl2 + trobj[i].innerHTML tbl2 = tbl2 + "</tr>" } //tbl = tbl+tbl2; len = trobj.length; len = len +1; tbl2 = tbl2 + GenerateRow() len = len +1; } tbl = tbl + tbl2 + "</table>"; //alert(tbl) document.getElementById("service_table").innerHTML=tbl; } </SCRIPT> </head> <body> <table width="909" border="0" cellpadding="0" cellspacing="0" bgcolor="#d2e8fd" id="tbl1"> <tr> <td width="7" align="left" valign="top"><img src="images/cor-topLeft.gif" width="7" height="6" alt=""/></td> <td width="894"> </td> <td width="8" align="right" valign="top"><img src="images/cor-topRight.gif" width="7" height="6" alt=""/></td> </tr> <tr> <td> </td> <td class="formText"> <input name="textfield10" type="text" class="inputText" id="textfield10" size="20" /> @yourdomain.com points to <select name="select3" class="dropDown" id="select3"> <option>Select</option> <option selected="selected">miles</option> </select> @yourdomain.com</td> <td> </td> </tr> <tr> <td align="left" valign="bottom"><img src="images/cor-botLeft.gif" width="7" height="6" alt=""/></td> <td> </td> <td align="right" valign="bottom"><img src="images/cor-botRight.gif" width="7" height="6" alt=""/></td> </tr> </table> <div id='service_table'></div> <table width="924" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="754"> </td> <td width="108" class="addUser"><strong>Add email alias</strong></td> <td width="62"> <img src="images/plus.gif" alt="Add User" onclick="AddLastRow();"/></td> </tr> </table> </body> </html>
I must admit that javascript is not my strong suit, but I will try to help. The line
What happens in javascript if you call a function without the parameter in the method signature? Also you appear to be missing several ;'s to end your statements, not sure what effect this might have?
html Syntax (Toggle Plain Text)
tbl2 = tbl2 + GenerateRow()
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. ![]() |
Similar Threads
- Intermitent Problem with No Video Input at Start (Windows NT / 2000 / XP)
- How to create input text field in flash (Graphics and Multimedia)
- create input boxes on the fly? (PHP)
- tokenize an input text file.. (Java)
- User input into text file (Perl)
- Selecting all input text fields (JavaScript / DHTML / AJAX)
- Create and write a text file that saved in network folder (ASP.NET)
- Input Text colour in forms and submit (Graphics and Multimedia)
- problem with convert jumbled text file to unjumbled text file (C)
Other Threads in the PHP Forum
- Previous Thread: problem with remembering selected drop down option
- Next Thread: Display Number of Times X Value is Empty
Views: 319 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cookies cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





