This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Row Building in Mozilla Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Row Building in Mozilla" Watch "Row Building in Mozilla" New topic

Row Building in Mozilla

Ayyappan Selvaraj
Ranch Hand

Joined: Sep 20, 2004
Posts: 63
Im using Javascript to build rows(with input box and combo box) in my JSP. But I find that it doesnt work pretty well with Mozilla browser.
Can anyone help me?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63349

My crystal ball is on the fritz. How about posting some code?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ayyappan Selvaraj
Ranch Hand

Joined: Sep 20, 2004
Posts: 63
This is my sample code. This I use in JSP. I need JAVA code that will build the multiline without using javascript

<script language="javascript">
function divBuild()

var count = document.check.rowCount.value;

divID = 'build' + count;
obj = document.getElementById(divID);
count = count + 1;
//obj.innerHTML+="<div id='remBuild"+count+"'><td>Build"+count+"</td><td> <a href='javascript:remove("+count+")'>remove</a></td></tr><tr><td colspan='2'><div id='build"+count+"'></div>"
obj.innerHTML+="<div id='remBuild"+count+"'>Build"+count+"<input type='text' name='txt1"+count+"'></div><div id='build"+count+"'></div>";
document.check.rowCount.value = count;
<form name="check" method ="post">
<input type="hidden" name="rowCount" value="0">
<tr><td>Build1</td><td><input type="text" name="txt1"></td></tr>
<tr><td colspan="2"><div id="build0"></div></td></tr>
<tr><td colspan="2"><a href="javascript ivBuild();">Build!</a></td></tr>
Ayyappan Selvaraj
Ranch Hand

Joined: Sep 20, 2004
Posts: 63
The code that I gave previously doesnt allow me to sumbit the form in Mozilla and no error is thrown
Can u please help me out.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Your code is making bad HTML format since you have divs tested inside of the table tag. Big no no.

Do a search on google for: JavaScript insertRow insertCell

That will show you the correct way to add new rows to a table.

I agree. Here's the link:
subject: Row Building in Mozilla
It's not a secret anymore!