Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Cancel Click on DHTML Edit Control

Hi, I have a form with a DHTML edit control on it. It is displaying an html page that includes links and a form. I want this to be for display purposes only so I need to prevent the submit button from submitting the form and to stop links being followed.

I'm using this sub to set cancelbubble and returnvalue to false and true respectively.

Private Sub HTMLDisplay_onclick(ByVal sender As Object, ByVal e As System.EventArgs) Handles HTMLDisplay.onclick
HTMLDisplay.DOM.parentWindow.event.cancelBubble = True
HTMLDisplay.DOM.parentWindow.event.returnValue = False
End Sub

But no dice. I've tried setting these values in both onmousedown and onmousedown which both fire before the onclick but again nothing seems to stop it. Can anyone throw me a bone here?

Cheers
[829 byte] By [MarkDuncan] at [2007-11-11 10:13:52]
# 1 Re: Cancel Click on DHTML Edit Control
I would probably download the HTML from the server and modify it, removing the form's action attribute and the hrefs from anchor tags, before displaying it.
Phil Weber at 2007-11-11 20:48:22 >