• 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

Row Building in Mozilla

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My crystal ball is on the fritz. How about posting some code?
 
Ayyappan Selvaraj
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic