This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Javascript DOM and tapestry 5

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody!! im new on tapestry and i have a little question, how can i get the value of an input that was dynamically added into the form with javascript, i know that is easy to add inputs whit ajax but i realy think that its faster and better specially for tapestry type apps, so this is the html code, any suggestion?

-html xmlns:t=""_
-script type="text/javascript"_
function addRecord(){
var count = document.getElementById("count");
var rows = document.getElementById("rows");
count.setAttribute("value", parseInt(count.value,0)+1);
var table = document.getElementById("content").tBodies[0];
var row = document.createElement("TR");

var cell1 = document.createElement("TD");
var nameBox = document.createElement("INPUT");
nameBox.setAttribute("name","nameBox" + count.value);

var button = document.createElement("a");
button.innerHTML = count.value;
button.on click=function(){deleteRecord(this);}



function deleteRecord(button){
var row = button.parentNode.parentNode;
var table = document.getElementById('content').getElementsByTagName('tbody')[0];

-body on Load="addRecord()"_
-input name="count" type="hidden" id="count" value="0" /_
-input name="rows" type="hidden" id="rows" value="" /_
-t:form t:id="myForm"_
-table id="content"_
-td width="150" class="orillat"_Names-/td_
-input type="button" value="add row" on Click="addRecord()" /_
-input type="submit" on Click="rows.value=count.value, count.value="0" /_-/td_

i apreciate any help
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not that I can help, but please re-post you code into CODE tags. So that the code is readable and indented. There are buttons under the Add Reply button to do this. Look for the one called CODE.


carlos smythe
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i didnt see that button next time i post im going to use it, but right now Howard Lewis tells me how to do what i want to do. thanks.
Good heavens! What have you done! Here, try to fix it with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic