• 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

Variables do not display on form correctly

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please forgive me, because I am a newcomer to JavaScript. But I am having the following problem: I created a form that displays some variables, and I am changing the values of those variables based on the results of AJAX calls. For some reason, after the listener executes, even though the variable values look correct in FireBug, they are not changed on the browser. Here is the javascript. Please help if possible:


 
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
Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
 
Bob Lawson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the tip. I fixed it.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What variables? What do you expect to get updated, you do not see variables, you see textthat you add to form elements and other DOM elements.

Eric
 
Bob Lawson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:What variables? What do you expect to get updated, you do not see variables, you see text that you add to form elements and other DOM elements.

Eric



Variables: pageDescription, executorState and applytBtn. These variables/form elements display properly initially, but when the user clicks applyBtn, a server-side call is made to start/stop the widget executor. Upon return from that (lines 63-78), the button text should be changed to 'Stop Executor' / 'Start Executor' (its a toggle). Also, the executorState should change to convey the current state of the widget executor ('The executor is currently running' or 'The executor is not currently running'). In Firebug, it shows that the changes were made to pageDescription, executorState and applytBtn. However, the html does not contain the changes.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the page posting back?

Make sure to cancel the button click.

Eric
 
Bob Lawson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:Is the page posting back?

Make sure to cancel the button click.

Eric


I'm not sure what you mean. Could you elaborate?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic