File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Javascript DOM and tapestry 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Javascript DOM and tapestry 5" Watch "Javascript DOM and tapestry 5" New topic

Javascript DOM and tapestry 5

carlos smythe

Joined: Dec 20, 2008
Posts: 2
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
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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.



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
carlos smythe

Joined: Dec 20, 2008
Posts: 2
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.
I agree. Here's the link:
subject: Javascript DOM and tapestry 5
It's not a secret anymore!