• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dynamically insert row with focus next

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need help. I am using set attribute I am trying to attach event focus next. it is not working...


newInputs[1].setAttribute('name', 'statename[]');
newInputs[1].setAttribute('id','state_name_' + rowNumber);
newInputs[1].setAttribute('type','text');
newInputs[1].setAttribute('size', '25');
newInputs[1].setAttribute('disabled', 'true');
newInputs[1].setAttribute('align', 'left');

newInputs[2].setAttribute('name', 'miles[]');
newInputs[2].setAttribute('id','miles_' + rowNumber);
var m = 'miles_' + rowNumber;
newInputs[2].setAttribute('type','text');
newInputs[2].setAttribute('size', '10');
newInputs[2].setAttribute('align', 'right');
newInputs[2].setAttribute('onkeypress', "function()return focusNext(this, 'gallons_' + rowNumber, event)");

newCells[i].appendChild(newInputs[i]);
newRow.appendChild(newCells[i]);
}

myTableBody.appendChild(newRow);
}

}

[ March 30, 2005: Message edited by: bharat parekh ]
[ March 30, 2005: Message edited by: bharat parekh ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this....

[ March 30, 2005: Message edited by: Eric Pascarello ]
 
bharat parekh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No I tried before I posted to your side...

It focus to the one on the page with hard code...

is there any way I can talk to you!!!
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have this code available running somewhere?

what is the function focusNext?

after you add a row, type into the location bar

javascript:document.write(document.body.innerHTML);

then look at the source code, does the event caller look correct?

Eric
[ March 30, 2005: Message edited by: Eric Pascarello ]
 
bharat parekh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric,

Do you have this code available running somewhere?
--->No ! we are still on internal server.

what is the function focusNext?
--->this is Javascript function Focus next(This.form, nextfield, event);

after you add a row, type into the location bar
javascript ocument.write(document.body.innerHTML);
then look at the source code, does the event caller look correct?

---> what is location bar.

Bharat
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
address bar......
 
bharat parekh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when I view source then I can't see any event's attached..

bharat
reply
    Bookmark Topic Watch Topic
  • New Topic