• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Problem to use innerHTML.

 
Ranch Hand
Posts: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp page that that use a input tag with type hidden, this is a input that I fill by a javascript function but my innerHTML not work.
Input tags:

Javascript  that getting the cell clicked and create the var to innerHTML in the input tag:

This alert is to see if my var "especialidade" was filled with clicked cell and in this case yes, content of var is the clicked cell. See that the innerHTML worked for a var but is not working to fill in value of input tag.
Thanks in advance.
 
Cezar Apulchro
Ranch Hand
Posts: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I don't get any errors it just doesn't do anything.
Thnaks.
 
Master Rancher
Posts: 245
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java != JavaScript
 
Cezar Apulchro
Ranch Hand
Posts: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, what I must to do?
 
Sheriff
Posts: 67645
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
I believe he was pointing out that you posted this in "Java in General" and it has nothing to do with Java. This post has since been moved to the HTML and JavaScript forum.

innerHTML can be DOM nodes and isn't really suitable for assigning as a value. What is it you are actually trying to capture? What kind of element is cel? Perhaps innerText might be more suitable?

Or perhaps you're going about this from the wrong direction. Generally "screen-scraping" isn't the best approach. You mentioned JSP; is the content of whatever cel represents available as data?
 
Matthew Bendford
Master Rancher
Posts: 245
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:sorry, what I must to do?



Java != JavaScript
in a bit more comprehensible terms: "Java" is-NOT-equal-to "JavaScript"
it's the short, bit rude/rough hint to some OP "dude, you posted in the wrong forum"
your question is about the web-language JavaScript - the forum you posted in is about the vm-language Java - and it's only for marketing reasons both share the same name (read up the history of EcmaScript during the browser war in early 90s)
it's common habbit of users in forums specialized on Java to point out that topics about JavaScript are just in wrong place
the rude/rough part of it is about making fun of mostly beginners lacking the knowledge to understand the difference between the two languages in terms like "hey, look, another beginner who can't read more than three/four letters"
I know some forums with such strict policies where such beginner mistakes result in long time or even permanent bans
 
Bear Bibeault
Sheriff
Posts: 67645
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
Yeah, CR is not that place 🙂
 
Cezar Apulchro
Ranch Hand
Posts: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved my problem, the solution was:

Thanks and best regards.
 
pie. tiny ad:
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