⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

A few newbie questions regarding javascript and GC



Charly

Charly
  • profile picture
  • Member

Posted 05 December 2017 - 15:06 PM

Hey guys. I'd appreciate your input on this. I'm setting up custom actions for my crud to archive a record and I'm not sure about a few things.

 

I've set up GC to call the javascript function to confirm the action with the URL passed into it. E.g. javascript:doconfirm('example.com/files/archive/5'). If the user confirms then the user is redirected to the passed URL and once the method is ran, the user is returned using redirect($_SERVER['HTTP_REFERER']);

 

It seems like GC has a much bettter way of doing their delete confirmations but I can't figure it out. When a recod is deleted, the page doesn't reload and a success/error message is shown. I've noticed that if I access the URL directly, I get the error/success message (example link). How is this message then displayed?

 

Thanks again