aspose file tools*
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
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Row Building in Mozilla" Watch "Row Building in Mozilla" New topic
Author

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
Marshal

Joined: Jan 10, 2002
Posts: 61227
    
  66

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

<html>
<head>
<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;
}
</script>
</head>
<body>
<form name="check" method ="post">
<input type="hidden" name="rowCount" value="0">
<table>
<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>
</table>
</body>
</form>
</html>
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
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Row Building in Mozilla