problem with checkbox control

Results 1 to 2 of 2

Thread: problem with checkbox control

  1. #1
    Join Date
    Dec 1969

    Default problem with checkbox control

    I can't seem to use a checkbox control and attach a javascript command to it. What I want to do is have a checkbox on the form so when someone checks it, it asks them "are you sure you want to delete this?" and if they confirm, then submit the form. So, I used a regular checkbox and submit the form and on the page load, I check to see if they checked the box and if so, run my delete procedure. It all works except that it's also firing my page validation so that it comes back and tells me that a certain field is required. Since I can't use a checkbox control (since I want to double check and make sure they want to delete by running page javascript), then how can I attach a server side event handler to the html checkbox so it hits the event handler instead of the page load and therefore doesn't try to validate? Any ideas? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: problem with checkbox control

    you could 'cheat' and when you are deleting you set the required feilds to " " or 0 accordingly. So, on the server-side code have a condition checking if you are deleting or submitting. I haven't used .NET much at all but i think the logic would be the same.

Posting Permissions

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