How to reload a form from a on change client script ?

sumeetkumardas
Kilo Contributor

I tried with this script but it doesn't works .

if (( oldValue == -5   && newValue == 1 ) || ( oldValue == -5 && newValue == 2 ) || ( oldValue == -5   && newValue == 7 ) || (oldValue == -5   && newValue == 4) || (oldValue == -5 && newValue == 5))

  {

  return confirm('Incident in Pending state can only move to In Progress or Resolved');

  reloadWindow(incident);

  location.reload();

  var answer = confirm("Incident in Pending state can only move to In Progress or Resolved");

  alert('success1'+answer);

  if (answer == ok)

  {

  alert('success');

  reloadWindow(window);

  }

  else

  reloadWindow(window);

  }

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron
10 REPLIES 10

Chuck Tomasi
Tera Patron

Have you tried



location.reload()



Location reload() Method


Tried but seems it doesn't work



return confirm('Incident in Pending state can only move to In Progress or Resolved');


location.reload(forceGet);


also with


location.reload(true);


Mike Allen
Mega Sage

Why would you not just remove those options in the field.



onLoad



if(g_form.getValue('state') == -5){


        g_form.removeOption('state', 1);


        g_form.removeOption('state', 4);


        [etc...]


}