JavaScript - Select Table Row Within A Table That Has A Td Of Foo
I have a master page with a table that contains main content and side bar content. The main content is where the different pages of the site are shown, and the side bar content has stuff like email and friends lists.
The mail list is on a model popup and when opened will ajax populate the table with rows containing image, subject, sender, time, all in different td's. When I click a row, the message pops up. From the message I can choose to reply or delete. When I delete I want to fade out the row that was deleted. I can wait the 10 seconds until the list does a refresh but I would rather have this cool visual effect. My problem is I am having difficulty selecting the tr I want. My table has an id of MainMailTable and when I check it does not have the ct100: added in front. Here is what I am trying: Code: $('#MainMailTable:tr:has(td:contains(' + subject + '))').fadeOut(1000); I am trying to find the row that contains the subject of the message I want to delete. I guess that isnt really unique, and maybe I should add a hidden td with an id to the row (can Jquery get a hidden field?). But I would like to be able to get this first step to work. When I try: Code: $('tr:has(td:contains(' + subject + '))').fadeOut(1000); the whole page disappears, so I think I may be close. Thank you in advance for any assistance. Similar TutorialsI use an api which is javascript and jQuery enabled. I have function with sender and args parameters. With args.cell.innerHTML I can change inner html property of the cell. How can I change row background color? I can change cell background with Code: args.cell.style.background = "#ff0000"; I tried with Code: args.cell.childNodes.style.background = "#AFD4EF"; args.cell.parent().childNodes.style.background = "#AFD4EF"; args.cell.parent().parent().childS().style.background = "#AFD4EF"; args.row.style.background = "#AFD4EF"; I'm working on a content management system for my website, and when you add a new user, there is an option to select the users class, such as member, moderator, administrator. I want to make it that when moderator or admin is selected, a new table row appears under it showing options for the users permissions. Also, the PHP script for adding users checks the information for errors. If there are errors, it will display them. All of the form info is posted to the error page. Therefore if moderator or admin is selected, the permissions need to come up as well. I tried googling this but I could only find ways to make this happen with DIV's. Thank you in advance for any help you may be able to give me. My issue is that I have a javascript function applied on page load via an addLoadEvent function call in the head to every row (dynamic number of records retrieved) on a table. On every row of the table I also have an element (image or button) that performs a different function that is assigned on the element itself. Unfortunately, when I click the element it also performs the function that was applied to the row in the page load. Is there any way to not call this function on element click? I know usually you include code, but due to the nature of the work I am limited in that respect. Basically its: Code: <script type="text/javascript"> addLoadEvent(function() { function1(1); }) //function1 makes the table rows do something appearance wise. </script> <tr> <td></td> <td></td> <td> <img src="pics/delete.png" alt="Delete" onclick="function2();"> </td> </tr> I apologize if my post doesn't conform to the general guidelines of proper posting on this board. I'm new on this site. hi guys i having some problems with jquery plugin table sorter on a dynamic table. if i use it on a regular html table it works fine,but on my dynamic table its not working. if someone could look at my code and see if i done something wrong i would appreciate it . Thanks will43 Code: <script type="text/javascript" src="table sorter/jquery.tablesorter/jquery-latest.js" ></script> <script type="text/javascript" src="table sorter/jquery.tablesorter/jquery.tablesorter.js" ></script> <script type="text/javascript"/> $(document).ready(function() { $("#myTable").tablesorter(); } ); </script> <form id="form1" name="form1" method="post" action=""> <label for="Position">Position</label> <select name="Position" id="Position"> <option>QB</option> <option>HB</option> <option>FB</option> <option>WR</option> <option>TE</option> <option>RG</option> <option>RT</option> <option>C</option> <option>LG</option> <option>LT</option> <option>CB</option> <option>LB</option> <option>SS</option> <option>FS</option> <option>DE</option> <option>DT</option> <option>P</option> <option>K</option> </select> <input type="submit" name="Summit" id="Summit" value="Submit" /> </form> <p> </p> <p> </p> <table width="950" border="1" cellpadding="3" cellspacing="3" class="tablesorter" id="myTable"> <thead> <tr> <th bgcolor="#FF0000">id</th> <th bgcolor="#FF0000">Team</th> <th bgcolor="#FF0000">FirstName</th> <th bgcolor="#FF0000">LastName</th> <th bgcolor="#FF0000">Position</th> <th bgcolor="#FF0000">Year</th> <th bgcolor="#FF0000">Overall</th> <th bgcolor="#FF0000">Speed</th> </tr> </thead> <?php do { ?> <tbody> <tr> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['id']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Team']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['FirstName']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['LastName']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Position']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Year']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Overall']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Speed']; ?></td> </tr> </tbody> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table> Hello all i have to implement simple LIFO algorithm ( if i can call it like this .. ) say i have html table and and i fetching data i like thet the last data that fetched to be the first record in the table for example : im fetching the string "111" so it will be the first record next im fetching the string "222" now the string "111" will be the second and the string "222" will be the first .. and so on hi all, i have a table, just a basic table with 6 rows. depending on the value of the first <td>thevalue</td> i want to start a end the existing table and start a new one. the newly added table (i hope) will contain all the remaining <tr><td></td></tr> nodes until i run into the next check that will close the newly added table and begin a new table again etc.... i can get the correct node (tr) after i find the value in the td im looking for, and then try a : document.createElement("table"); , but my problem is that this newly created table tag comes with an automatically created </table> element / tag, so i end up with just inserting a new blank table after a row instead of inserting a new table tag that has all the remaining tr and tds under it. hope that makes sense. my entire test page is: (click the text link and an alert will show the output with the new <table></table> after the row that my check is looking for (first td with a 2) -------------------------------------------------------------------- Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/javascript"> function reformatMe() { var divObj = document.getElementById('reformatMe'); var numRows = document.getElementsByTagName("tr"); var z = "1"; for (i = 0; i < numRows.length; i++) { if (numRows[i].childNodes[0].innerHTML == "2") { var markStart = numRows[i]; alert(markStart.nextSibling); var closeTable = document.createElement("/table"); var addTable = document.createElement("table"); //var tbody = document.createElement("tbody"); //addTable.appendChild(tbody); addTable.setAttribute("id", "subOptionID" + z); if(numRows[i+1] != null){ numRows[i].parentNode.insertBefore(addTable, numRows[i+1]); } z++; } } alert(divObj.innerHTML); } </script> </head> <body> <a href="#" onclick="reformatMe();">reformat table</a> <div id="reformatMe"> <table border="1" cellpadding="4" cellspacing="2" id="menuItemID1"> <tr><td>1</td> <td>1</td> <td>How would you like your food prepared?</td> <td>1</td> <td>1</td> <td>0</td></tr> <tr><td>1</td> <td>1</td> <td>Choose two of the following sides</td> <td>0</td> <td>2</td> <td>0</td></tr> <tr><td>1</td> <td>1</td> <td>What do you want on your Baked Potato?</td> <td>0</td> <td>2</td> <td>1</td></tr> <tr><td>2</td> <td>1</td> <td>What type of dressing do you want on your salad?</td> <td>1</td> <td>1</td> <td>1</td></tr> <tr><td>1</td> <td>1</td> <td>Do you want fries?</td> <td>1</td> <td>1</td> <td>0</td></tr> <tr><td>1</td> <td>1</td> <td>Do you want ketchup on your fries?</td> <td>1</td> <td>1</td> <td>1</td></tr> </table> </div> </body> </html> I've tried using this to do it, but it isn't working... string.replace(/(<table([^>]+)table>)/ig,""); Hello Everyone, So I am attempting to put a table within my JavaScript. However, everything that I try does not work. I have done a ton of research on how to do this but it's always with different scenarios, or it just does not work for me. Any hints would be appreciated, thanks! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD xHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="stylesheet" type="text/css" href="UNIT_3.css"/> <title></title> </head> <body> <script type="text/javascript"> <!-- document.write('<h1>Number Square<h1> <br/>'); document.write('<table>'); for(var intSquare = 1; intSquare <=10; intSquare++) { document.write('<tr>'); document.write('<td>' + intSquare + "" + intSquare + '</td>'); document.writeln(intSquare + "" + intSquare * intSquare); document.write('</tr>'); document.writeln("<br/>"); } document.write('</table>'); // --> </script> </body> </html> Hello; I'm a little new at JavaScript, but I've programmed before. I've converted a Sales Tax Table program from BASIC to JavaScript and I need a little help. The following is an entire HTML code. The results should appear in the text boxes, but they don't seem to appear. Any help would be appreciated. Code: <html> <head> <title>Sales Tax Table Maker</title> <script language="JavaScript"> function numbercrunch() { var st = 0; var tt = 0; var centlow=newArray(); var centhigh=newArray(); if (int(r+.5) > int(r)) { st = int(r+1); } for (a = 0; a <= 99; a++) { tt = (a*r); if (int(tt+.5) > int(tt) { tt = int(tt+1); } if (tt = 0) {centhigh[tt] = a;} if (tt = 0) { if (centlow[tt] = 0) { centlow[tt]= a; }} if (tt > 0) {centhigh[tt] = a;} } form.d1.value = (1*r); form.d2.value = (2*r); form.d3.value = (3*r); form.d4.value = (4*r); form.d5.value = (5*r); form.d6.value = (6*r); form.d7.value = (7*r); form.d8.value = (8*r); form.d9.value = (9*r); form.d10.value = (10*r); form.c1a.value = centlow[0]; form.c1b.value = centhigh[0]; form.c2a.value = centlow[1]; form.c2b.value = centhigh[1]; form.c3a.value = centlow[2]; form.c3b.value = centhigh[2]; form.c4a.value = centlow[3]; form.c4b.value = centhigh[3]; form.c5a.value = centlow[4]; form.c5b.value = centhigh[4]; form.c6a.value = centlow[5]; form.c6b.value = centhigh[5]; form.c7a.value = centlow[6]; form.c7b.value = centhigh[6]; form.c8a.value = centlow[7]; form.c8b.value = centhigh[7]; form.c9a.value = centlow[8]; form.c9b.value = centhigh[8]; form.c10a.value = centlow[9]; form.c10b.value = centhigh[9]; } </script> </head> <body> <h2> Sales Tax Table</h2> <input type=text size=4 value=8.9 name="r"> <input type="button" value = "OK" onClick="numbercrunch()"> <table border = "1"> <tr> <td>If whole dollars is... <td>Add this to sales tax... <td>If cents is between... <td>Add this to sales tax... </tr> <tr> <td>$1 <td><input type="number" size=5 value=0 name="d1"> cents <td><input type="number" size=5 value=0 name="c1a"> and <input type="number" size=5 value=0 name="c1b"> cents <td>Nothing </tr> <tr> <td>$2 <td><input type="number" size=5 value=0 name="d2"> cents <td><input type="number" size=5 value=0 name="c2a"> and <input type="number" size=5 value=0 name="c2b"> cents <td>1 cent </tr> <tr> <td>$3 <td><input type="number" size=5 value=0 name="d3"> cents <td><input type="number" size=5 value=0 name="c3a"> and <input type="number" size=5 value=0 name="c3b"> cents <td>2 cents </tr> <tr> <td>$4 <td><input type="number" size=5 value=0 name="d4"> cents <td><input type="number" size=5 value=0 name="c4a"> and <input type="number" size=5 value=0 name="c4b"> cents <td>3 cents </tr> <tr> <td>$5 <td><input type="number" size=5 value=0 name="d5"> cents <td><input type="number" size=5 value=0 name="c5a"> and <input type="number" size=5 value=0 name="c5b"> cents <td>4 cents </tr> <tr> <td>$6 <td><input type="number" size=5 value=0 name="d6"> cents <td><input type="number" size=5 value=0 name="c6a"> and <input type="number" size=5 value=0 name="c6b"> cents <td>5 cents </tr> <tr> <td>$7 <td><input type="number" size=5 value=0 name="d7"> cents <td><input type="number" size=5 value=0 name="c7a"> and <input type="number" size=5 value=0 name="c7b"> cents <td>6 cents </tr> <tr> <td>$8 <td><input type="number" size=5 value=0 name="d8"> cents <td><input type="number" size=5 value=0 name="c1a"> and <input type="number" size=5 value=0 name="c8b"> cents <td>7 cents </tr> <tr> <td>$9 <td><input type="number" size=5 value=0 name="d1"> cents <td><input type="number" size=5 value=0 name="c1a"> and <input type="number" size=5 value=0 name="c9b"> cents <td>8 cents </tr> <tr> <td>$10 <td><input type="number" size=5 value=0 name="d1"> cents <td><input type="number" size=5 value=0 name="c10a"> and <input type="number" size=5 value=0 name="c10b"> cents <td>9 cents </tr> </body> </html> Hi all, I need some help to update my table.It consists about selecting one team from each two drop-down list and enter the score to the two textbox. Textbox 1 relate to the team selected from the first drop-down list and textbox2 relate to the team selected from the second drop-down list.If the score entered in textbox1 is greater than textox2 means that team selected from the first drop-down win and need to update the point of the related team in the table. win = 3 point draw = 1 point lost = 0 point Here what I have down so far...any idea or referencing how I can tackle this task? Code: <form id="foot"> <label for="first">Please select the first team:</label> <select id="first"> <option value="team 1">team 1</option> <option value="team 2">team 2</option> <option value="team 3">team 3</option> </select> <label for="second">Please select the second team:</label> <select id="second"> <option value="team 1">team 1</option> <option value="team 2">team 2</option> <option value="team 3">team 3</option> </select> <input type="submit" value="Update"/><br/> <label for="username">Enter score for the match (First team and Second team)</label> <input type="text" id="txtbox1" size="2"/> <input type="text" id="txtbox2" size="2"/> </form><br/> <table border="1" width="50%" id="score"> <thead> <tr> <th>Team</th> <th>Point</th> </tr> <tbody> <tr> <td>Team 1</td> <td>30</td> </tr> <tr> <td>Team 2</td> <td>20</td> </tr> <tr> <td>Team 3</td> <td>10</td> </tr> </tbody> </thead> </table> function updateTable(){ var form = document.getElementById("foot"); var firstdrop = document.getElementById("first"); var seconddrop = document.getElementById("second"); var box1 = ParseInt(document.getElementById("txtbox1").value); var box2 = ParseInt(document.getElementById("txtbox2").value); var table = document.getElementById("score"); arrwin = ["3"]; arrdraw = ["1"]; arrlost = ["0"]; } </script> Hello there, I'm an IT student that recently started to learn JavaScript. I'm trying to write a code that starts with a prompt inputs a number like n. Then the code will ask another n prompts for data input. For example I will input 5 for first prompt, code will ask for 5 more prompts for input. Can't figure out how to do it
Code: rownumber = 2; detailsTable = document.getElementsByName("detailsTable"); detailsRow = detailsTable.getElementsByTagName("tr")[rownumber]; name = detailsRow.getElementsbyTagName("td")[0]; address = detailsRow.getElementsbyTagName("td")[1]; address2 = detailsRow.getElementsbyTagName("td")[2]; phone = detailsRow.getElementsbyTagName("td")[3]; email = detailsRow.getElementsbyTagName("td")[4]; alert(name); I have been told if I want to get the text from each cell I can use: alert(name.firstChild.nodeValue); But I don't understand how to do this for what I am wanting to do. Here is my HTML: Code: <table border="0" name="detailsTable"> <tr> <td>a</td> <td>b</td> <td>c</td> <td>d</td> <td>e</td> </tr> </table> Hi All, I have this table with a repeat region (this pulls a series of records from my database and displays them in the table). I have a button in one of the table cells that calls a function to delete the current row where the button is pressed (I am trying to pass the row index to the function). Here is what I have which is clearly wrong but I am hoping someone can offer an option that will work. Code: <script type="text/javascript> function deleteRow(tableID,tr) { //alert('tableID is '+tableID+' and rowCount is '+tr); if (document.getElementById(tableID)) { try { var table = document.getElementById(tableID); var rowCount = table.rows.length; for(var i=0; i<rowCount; i++) { var row = table.rows[i]; //alert ("row is "+i); if(i == tr) { table.deleteRow(i); i++; if(rowCount==0){ table.parentNode.removeChild(table); } } } }catch(e) { alert(e); } } } </script> <table id="dataTable" width="100%" border="0"> <?php do { ?> <tr> <td width="33%"><?php echo $row_rstRequestedEquip['EquipNeeded']; ?></td> <td width="33%"><?php echo $row_rstRequestedEquip['Quantity']; ?></td> <td width="33%"><input type="button" name="remove" value="Remove" class="button" onclick = "deleteRow(dataTable,this.rowIndex)" /></td> </tr> <?php } while ($row_rstRequestedEquip = mysql_fetch_assoc($rstRequestedEquip)); ?> </table> Thanks in advance for any help. Kind regards, Ken I have code that hides some check boxes based on what is selected in a radio button, and it works great. I am wondering if it could hide the entire table row instead of just the boxes so it decreases white space on my form, Here is my current code, <tr id="playIntroRow"> <td class="editLabel"><span>*</span>Play Intro:</td> <td> <label>Yes <input type="radio" name="playintro" value="1" onclick="document.getElementById('voiceIntroRow').style.visibility='visible';" /> </label> <label>No <input type="radio" name="playintro" value="0" checked onclick="document.getElementById('voiceIntroRow').style.visibility='hidden';" /> </label> </td> </tr> </cfif> <cfif voiceStatus eq "on"> <tr id="voiceIntroRow" style="visibility: hidden;"> <td class="editLabel"><span>*</span>Intro Message:</td> <td><cfscript>voiceIntroRenderer.Render();</cfscript></td> </tr> </cfif> Hi All, I am working on a script to generate a dynamic table and populate the fields in that table with data from a number of text fields on my page. The page uses Adobe spry validation and this is the only way I can get my validation to function and add the data to the table dynamically (I had a script where the text fields were part of the first row and blank rows were added dynamically but the validation would not work for the added rows... This is a workaround). Being new to JS I did the best I could and I think it's clear what I am going for but I am sure my syntax and method usage is off. When I click to add the table row, I get "[object HTMLLabelElement]" in each cell (dunno what that is). Could someone please help me get going in the right direction with this code? Here it is and thanks in advance for any help. Code: A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> </style> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> </head> <SCRIPT language="javascript"> function addRow(tableID) { //These variable are commented out and coded inline below. //var StartTime = document.getElementById(StartTime); //var EndTime = document.getElementById(EndTime); //var MaterialID = document.getElementById(MaterialID); //var Title = document.getElementById(Title); var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell1 = row.insertCell(0); var element1 = document.createElement("input"); element1.type = "checkbox"; cell1.appendChild(element1); var cell2 = row.insertCell(1); var element2 = document.createElement("input"); element2.type = "text"; element2.setAttribute("id","StartTime[]"); //Set the value to the form's textfield. element2.value = document.getElementById(StartTime); cell2.appendChild(element2); var cell3 = row.insertCell(2); var element3 = document.createElement("input"); element3.type = "text"; element3.setAttribute("id","EndTime[]"); //Set the value to the form's textfield. element3.value = document.getElementById(EndTime); cell3.appendChild(element3); var cell4 = row.insertCell(3); var element4 = document.createElement("input"); element4.type = "text"; element4.setAttribute("id","MaterialID[]"); //Set the value to the form's textfield. element4.value = document.getElementById(MaterialID); cell4.appendChild(element4); var cell5 = row.insertCell(4); var element5 = document.createElement("input"); element5.type = "text"; element5.setAttribute("id","Title[]"); //Set the value to the form's textfield. element5.value = document.getElementById(Title); cell5.appendChild(element5); } function deleteRow(tableID) { try { var table = document.getElementById(tableID); var rowCount = table.rows.length; for(var i=0; i<rowCount; i++) { var row = table.rows[i]; var chkbox = row.cells[0].childNodes[0]; if(null != chkbox && true == chkbox.checked) { table.deleteRow(i); rowCount--; i--; } } }catch(e) { alert(e); } } </SCRIPT> <body> <span id="spryStartTime"> <label for id="StartTime">Start Time:</label><br /> <input name="StartTime" type="text" id="StartTime" tabindex="1" size="10" maxlength="8" /> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span><br /> <label for id="EndTime">End Time:</label><br /> <span id="spryEndTime"> <input name="EndTime" type="text" id="EndTime" tabindex="2" size="10" maxlength="8" /> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span><br /> <label for id="MaterialID">Material ID:</label><br /> <span id="spryMaterialID"> <input name="MaterialID" type="text" id="MaterialID" tabindex="3" size="10" maxlength="10" /> <span class="textfieldRequiredMsg">A value is required.</span></span><br /> <label for id="Title">Title:</label><br /> <span id="spryTitle"> <input name="Title" type="text" id="Title" tabindex="4" size="50" maxlength="50" /> <span class="textfieldRequiredMsg">A value is required.</span></span><br /> <INPUT type="button" value="Add Row" onclick="addRow('dataTable')" /> <INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" /> <!-- I would prefer not to start with a table with blank rows (but rather create the rows already populated) but I can work on this later. --> <TABLE id="dataTable" width="350px" border="1"> <TR> <TD><INPUT type="checkbox" name="chk"/></TD> <TD><INPUT type="text" /></TD> <TD><INPUT type="text" /></TD> <TD><INPUT type="text" /></TD> <TD><INPUT type="text" /></TD> </TR> </TABLE> <script type="text/javascript" /> var sprytextfield3 = new Spry.Widget.ValidationTextField("spryStartTime", "time", {validateOn:["blur"], format:"HH:mm:ss", useCharacterMasking:true}); var sprytextfield4 = new Spry.Widget.ValidationTextField("spryEndTime", "time", {format:"HH:mm:ss", useCharacterMasking:true, validateOn:["blur"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("spryMaterialID", "none", {validateOn:["blur"]}); var sprytextfield6 = new Spry.Widget.ValidationTextField("spryTitle", "none", {validateOn:["blur"]}); </script> </body> </html> hi, I am working on adding a datepicker on each row of the table grid using javascript . I have a done like below. Code: oCell.innerHTML = "<input type='text' name='DateTime' id='DateTime' size='18' class='maincontent1'> <a href=javascript:NewCssCal('DateTime','yyyymmdd','arrow',true,24,false);><img src='images/cal.gif' width='16' height='16' border='0'alt='Pick a date'> </a> "; Code: oCell = newRow.insertCell(); Is this correct way? with the above code , cursor control pointing to previous textbox not the current one. can anyone help me? thanks Hi, How I build a table based on a list under a <DIV></DIV> like this? printing: 1 and: 3 typesetting: 2 industry: 2 has: 2 been: 1 s: 1 standard: 1 ever: 1 since: 1 1500s: 1 when: 1 an: 1 unknown: 1 printer: 1 took: 1 a: 2 galley: 1 type: 3 scrambled: 1 Regards Bob Hi, I would like to increase my table row when users hit enter. Please find my html code below. Code: <form id="form1" name="form1" method="post" action=""> <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" id="tblSample"> <tr> <td align="center"><strong>NO</strong></td> <td align="center"><strong>DESCRIPTION</strong></td> <td align="center"><strong>QTY</strong></td> <td align="center"><strong>PRICE</strong></td> <td align="center"><strong>TOTAL</strong></td> </tr> <tr> <td align="center"><label> <input name="textfield2" type="text" id="textfield2" size="8" /> </label></td> <td align="center"><label> <input name="textfield" type="text" id="textfield" onclick="addRowToTable();" size="80"/> </label></td> <td align="center"><input name="textfield3" type="text" id="textfield3" size="8" /></td> <td align="center"><input name="textfield4" type="text" id="textfield4" size="8" /></td> <td align="center"><input name="textfield5" type="text" id="textfield5" size="8" /></td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center">total</td> </tr> </table> </form> Hi, Thank you for helping me and also read my post. Anyone know how to make a function of below request?. 1)Textarea for input text 2)Button for submit text 3)Submitted text into table 4)All the text into table one by one what i need help is 1) How to separate each word or text to table cols or rows 2) How to auto add another cols or rows once the text submit by Textares 3) How to separate each table th or tr by ID or Name like below Code: <table border="1"> <tr> <th>First</th> <th>scoend</th> <th>third</th> </tr> <tr> <td id="1">1</td> <td id="2">2</td> <td id="3">3</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </table> Thank you so much. |