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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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?
 
Marshal
Posts: 67497
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic