Performing two events(saving and deleting item) on button click in javascript in a dataview web part
Hello guys, I have a requirement like...I have a dvwp, in that I have comments field as text box. So that when ever user tries to delete the item, he enters comments and deletes it.It will send an notification with information and gets deleted. So I have to do this by javascript. Do you guys have any idea?
October 19th, 2010 2:50am

Do any body have any idea?
Free Windows Admin Tool Kit Click here and download it now
October 19th, 2010 5:32pm

Probably, All you need is validation to the textbox. The validation should occur when a user clicks on delete item. Is this assumption right? Thanks VV
October 19th, 2010 5:57pm

No, actually I want to do two things, saving the comments and then deleting the list item with a single button click using javascript? Can we able to do that?
Free Windows Admin Tool Kit Click here and download it now
October 19th, 2010 6:58pm

Where should the comments get stored? Do you have a list to store the comments? Are you using SharePoint 2010? Thanks VV
October 19th, 2010 7:21pm

There is a button, which has to do two things, saving the comments to the list and after that it has to delete the list item from list. Can we do this on click event for button in javascript in dvwp. I am using MOSS 2007 I am sending the information as notification in item deleting event handler(this is different)
Free Windows Admin Tool Kit Click here and download it now
October 19th, 2010 9:17pm

Hi, You cannot realize it only using JavaScript even if you allowing insert/edit/delete options in DVWP since you need to update the list item firstly before deleting it and only JavaScript cannot finish the update function when you clicking the delete button. If you add a new button in DVWP, you have to do some coding in code behind of the aspx.page using C# or VB.net to receive the comments. And in this case, you don’t need event handler any more for you can send the notification directly without updating the list item and then delete the list item. Or you can use JavaScript to clear the comments field and give a hint that you need to fill the comments field of the list item before deleting it. Hope it is helpful! Seven
October 20th, 2010 11:57am

Can you explain more about the second option. Like creating a button and writing code in c#. How can I do that?
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2010 7:43pm

Hi, For the second option, it is actually creating or editing the aspx page using asp.net. I think the point for this method is that how to deploy the code behind code into SharePoint and editing the page will be just like editing a page in ASP.NET. And here is a special article about deploy the code behind to the SharePoint: http://msdn.microsoft.com/en-us/library/cc411726(office.12).aspx Hope it is helpful!Seven
October 21st, 2010 11:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics