|
-
March 7th, 2009, 04:41 AM
#1
JavaScript MessageBox With "Yes" and "No" Buttons!!!!
Hello,
I am working on the page that will display a button for Save. Here I want some help from Javascript and in .CS file.
If that Save button is pressed, a message box should appear asking if the user is sure to Save or Update the record. If the user presses Yes then the browser goes to "If" loop to Save records in DataBase. If the user presses No then the user should go to If loop again and Update Those Records(If the records are already exists in the database) in the same page.
How can I do this job? I know that it might be a simple job but I suck in JS and in .CS file (I am not able to Get JavaScript Function Value[True and False] in .CS file.
Thanks...
-
March 10th, 2009, 01:57 AM
#2
Re: JavaScript MessageBox With "Yes" and "No" Buttons!!!!
I am not clear why you need javascript here. Inside the button click procedure for the save button, you can always check if records exist in the database based on on some input field. First check with some value (mostly the primary key value) if such a record exists in the database table and if it does update the record instead of inserting. I hope there is a primary key field in your table. If the record does not exist then go ahead and insert the record. All this can be done very well with one stored procedure which examines the input values and updates or inserts accordingly. There is no need to bring in javascript code here. Hope this helps.
Warm Regards,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|