Welcome Guest, Not a member yet? Register   Sign In
pop up message instead of error page
#1

[eluser]maniac[/eluser]
I am wanting to do a pop up message if someone tries to delete an item from the database that is connected to another table. I do get the error page, advising that the item cannot be deleted, but wanted to use a pop up instead, as it will look nicer and be easier for the person to read.

Can anyone help on how I go about it?

Thanks
#2

[eluser]erik.brannstrom[/eluser]
My take would be to use AJAX. This way you can handle the outcome of the validation with Javascript, so for example displaying a pop up message should be fairly easy. There are lots of resources on this, search the forums or Google. To get started, perhaps you would like to check this out: http://blufusion.net/2009/07/30/easy-ajax-post-with-jquery-and-codeigniter/
#3

[eluser]maniac[/eluser]
I don't think that is exactly what I am looking for (but maybe I am completely wrong!). I have a table and a delete button on it. When the person tries to delete something from the table and referential integrity stops the deletion, I want a pop up (or even new page) message to say the row can't be deleted and the reason in basic english terms. Currently, it just goes to a error page explaining the error in sql language.
#4

[eluser]theprodigy[/eluser]
I think what Erik was trying to say was to use ajax to send the delete request. The response given back will tell you whether the delete worked, or if it produced an error. If it worked, use javascript to delete the table row (or refresh the current page). If it didn't work, create your own pop to display to the user.

Erik, if I am wrong, please correct me.
#5

[eluser]erik.brannstrom[/eluser]
Nope, you are very much correct! Smile
#6

[eluser]maniac[/eluser]
Ok thanks. I will go off on a fact finding mission.

Maniac




Theme © iAndrew 2016 - Forum software by © MyBB