Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Mar 2008
Posts: 52
Reputation: hajjo is an unknown quantity at this point 
Solved Threads: 0
hajjo hajjo is offline Offline
Junior Poster in Training

Table id

 
0
  #1
31 Days Ago
I have a table, and insde the table dynamic inputtextboxes

how can i set the id of textbox "row" + row number

id of first textboxt row0, second one row1 and so on..
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,401
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 225
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey
 
0
  #2
31 Days Ago
Show us your code otherwise we're just guessing
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 319
Reputation: Luckychap is on a distinguished road 
Solved Threads: 42
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Posting Whiz
 
0
  #3
31 Days Ago
  1. function getId() {
  2. var table = document.getElementById('your-table-id');
  3. var rows = table.getElementsByTagName('tr');
  4. var newId;
  5. if(rows && rows.length) {
  6. var lastRowId = rows[rows.length-1].id;
  7. newId = 'row' + parseInt(lastRowId.substring(lastRowId.indexOf('row')+1, lastRowId.lendth)) + 1;
  8. } else {
  9. newId = 'row0';
  10. }
  11.  
  12. return newId;
  13. }
When you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC