I'm using PHP CodeIgniter with jQuery.
Say for example I have a <table>
(of employees perhaps).
Now above the said table I have an "Add Employee" button.
This button opens a jQuery-dialog
with the <form>
. When this form submits, it goes server-side of course (validates whether a duplicate entry or not), then it's sent back to corresponding view with the updated table.
What I want to do is to show a dialog that an employee is successfully added or that it is a duplicate entry.
I'm doing this by
appname/controller/action?addSuccess=true
or
appname/controller/action?addSuccess=false
everytime I return back to the view, then on my page, in my $(document).ready()
I check for such query string and opens the corresponding dialog (success or error dialog). My problem now is that, if I refresh the page (same url) I get the dialogs again (although nothing happens serverside).
QUESTION: Is this approach good enough? Any good advice to improve this? :)
Thanks a lot!.