Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Set JavaScript Value from Element Value

 
Ranch Hand
Posts: 1951
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a jsp file that I call from two different containers in my web application.

The file has this in the code to get a session value:



A call from container 1 will set this value to 0 while a call from container 2 will set it to 1.

Also in the jsp I have jQuery where I get this value:



My issue:

Container 2 makes the call and all is well.
Container 1 makes the call and all is well.
Now if I make a call from container 2 again the source value return 0 when I expected  a value of 1.
In this scenario if I inspect the HTML the value of the input is 1 yet the source value displays 0.
 
Steve Dyke
Ranch Hand
Posts: 1951
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I have solved this. If I call the .Empty() method on container 1 when it gets closed the problem goes away.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even you can make its value null like ::

 
Something about .... going for a swim. With this tiny ad ...
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!