No announcement yet.

Value for global variable do not change in event ajax

  • Filter
  • Time
  • Show
Clear All
new posts

  • Value for global variable do not change in event ajax

    Hi, i have a form master - detail
    i have a event ajax for a field city (field type SELECT) in this event i have a script: [g_myvar] = 3;
    i asign a value to a variable global in event onload [g_myvar] = 2;

    Then when my form load the variable [g_myvar] = 2 and when i change field city a other city, DO NOT CHANGE THE VALUE TO 3.

    I have a link type capture, i send this variable [g_myvar] as parameter but this always = 2;

    Why event ajax do not change this value to 3??

  • #2
    Because the variable is not 'real' global. In fact, you have to pass through the menu to get this value realy global. Same goes for sc_redir. If you set a global variable then do a sc_redir then the called application will show the old value until you refresh the page. In sc_redir you can solve this by passing the variable in the sc_redir parms, in your case, a solution might be to make the global a session variable.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      Thanks Albert, i take the variable as Global and works fine.