How to recalc javascript after a postback?
Last Post 09-01-2011 06:07 AM by sentient. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Mark BuelsingUser is Offline
river guide
river guide
Posts:241
Avatar

--
10-26-2010 08:00 PM
    Hi, on one paritcular form, my javascript calculations work fine when called from the client side event of each of the two radiobuttons whose values are needed in the calcs. The same javascript calculations are pasted in the "Initial Javascript" section of the form settings. So I am thinking that the javascript is solid, however if user hits a checkbox that runs a question event that unhides some fields, that triggers a postback, And the javascript calculations are not run during or after the postback. As a result, my calculations go back to their default values.

    1. I don't understand why the javascript appears to not run on postback
    2. Could it be because my calcs run a custom javascript function, and the custom function is read AFTER my calcs are run?
    3. Followup question, is the custom javascript read before the initial javascript on form postback? Or the other way around?
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    10-27-2010 06:45 AM
    Posted By Whetstone on 10/26/2010 10:00 PM
    Hi, on one paritcular form, my javascript calculations work fine when called from the client side event of each of the two radiobuttons whose values are needed in the calcs. The same javascript calculations are pasted in the "Initial Javascript" section of the form settings. So I am thinking that the javascript is solid, however if user hits a checkbox that runs a question event that unhides some fields, that triggers a postback, And the javascript calculations are not run during or after the postback. As a result, my calculations go back to their default values.

    1. I don't understand why the javascript appears to not run on postback
    2. Could it be because my calcs run a custom javascript function, and the custom function is read AFTER my calcs are run?
    3. Followup question, is the custom javascript read before the initial javascript on form postback? Or the other way around?
    Yes, I would be interested on this workaround.  I recently ran into the same issue.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-27-2010 10:42 AM
    Typically as long as all of your calculations are also placed under Initial JavaScript it will always be called after form validation, any post back, question events, etc... If its not then its likely because another JavaScript error caused it.

    I would load FireBug for FireFox and after clicking on your question event, do you see any JavaScript Errors? If so what are they?

    -Chad
    sentientUser is Offline
    river guide
    river guide
    Posts:127
    Avatar

    --
    08-31-2011 07:42 PM
    What ever happened with this... I have the exact same issue in Dynamic Registration
    Mark BuelsingUser is Offline
    river guide
    river guide
    Posts:241
    Avatar

    --
    09-01-2011 04:11 AM
    Sorry Sentient, I should have posted the final result a year ago, then we would have a record of the resolution. As it is, that was a year ago and I don't quite remember. I recommend that you try removing all the initial javascript for a moment (after copying it to notepad) and then adding your custom funcion back in to see if it works. If it does, add the other functions in one at a time and test in between each. You might find that one of the other functions in there is causing your function to stopworking.
    sentientUser is Offline
    river guide
    river guide
    Posts:127
    Avatar

    --
    09-01-2011 06:07 AM
    Thanks Whetstone, the issue I was having actually seems to be the version of Dynamic Registration I was running. It was not recent enough and was performing the postback in the wrong order.
    Using Dynamic Forms Ver:3.40.1.0 / 6.0.0 I see the issue was not there.


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi