CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Posts
    116

    Unhappy 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...

  2. #2
    Join Date
    Jan 2009
    Location
    Cochin, India
    Posts
    40

    Smile 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,
    Jay
    Support Resort
    http://www.supportresort.com
    Bringing offshore expertise to the world

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured