• 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
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

How to create JavaScript var with table cell?

 
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a JSP with table that is loaded with records of MySQL table and I have some input fields that must be loaded from JSP table. The problem is that my javascript always load the cell choiced to first input field. To solve this I need to create a javascript var with content of cell choiced but I don't know I do that this. I searched in web and study in books but I can't solve this.
This function are working fine.

What I want is to know how create a var whith content of table cell.
Thanks.
 
Cezar Apulchro
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved.
My solution to many inputs:

Thanks and best regards.
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Repeated block of code like that are an anti-pattern. Look at how there are only a few differences between the blocks.It would be very easy to take that repeated code and condense it into a parameterized function.
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another anti-pattern: global variable linha. Think: does it really need to be global?
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic