Welcome Guest, Not a member yet? Register   Sign In
ask to overwrite if file already exists in database
#1

[eluser]alberta[/eluser]
Hi,

I need your suggestions to implement this functionality.

I have to upload calendars in database. On clicking submit button it checks if name already exists in database or not (i have used call back function). if it exists then form validation fails and goes to form_view page again. What i want to do is when on error it goes to view page then it should ask to user if he/she wants to overwrite existing calendar or create a new calendar with some different name.

I dont know how to call js function on validation failure. Can somebody tell me how to do this? And even someone has better idea to implement this then do let me know.

Any help would be appreciated.

Thanks
#2

[eluser]bigtony[/eluser]
No need to use JS. You could put a checkbox on the page that says "Overwrite if name already exists?", which if checked will allow you to replace on the database, otherwise just gives error message. You could put it on the initial page as well, so as not to make it a two-step process for the user.




Theme © iAndrew 2016 - Forum software by © MyBB