Click here to Skip to main content
15,902,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
i have a php file in my website and there is a submit button that save data,
now i want that when i click this button it will perform some check in my database and after the check it will ask me if i want continue or cancel,
if i click continue it will submit this form and if i click cancel it will cancel and will be not submited.
how can i do it?
Posted

1 solution

Use XMLHttpRequest (using JavaScript - client side process)!
On button click, pass a request to server side with needed parameters. Do DB work, get back response and then based on result show a confirm. Now, based on confirm result direct the page execution flow.

Just Google for XMLHttpRequest in case you don't know.
 
Share this answer
 
v2
Comments
komissar2007 19-Sep-10 8:32am    
thanks for the quick response,
but can i do the job in php itself?
Sandeep Mewara 19-Sep-10 11:24am    
Yes, you should be able to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900