Jump to content

How to replace onclick event on Client Side


irigsoft

Recommended Posts

Hi, I need to do some functionality to make my own add-on by the client. This add-on will replace onclick events on some buttons.
Is this possible and is there any example I can see?

 

I want to do something like that but on Client Side independent of server functions (like just extend some button OnClick):

Just trying to insert functionality to the click event. 
It adds the function call to the start of the click event and then allows the default behaviour to occur, in this case a form submission:
 $(function() {
    $('[onclick*=WebForm_DoPostBackWithOptions]').click(function(event) {  

        //call your custom functions here and then do nothing, the 
        //default click event will still occur. If you don't want it to
        //propagate, call event.preventDefault();

        var txt = this.onclick;
        txt = txt + '';
        txt = txt.replace('WebForm_DoPostBackWithOptions','ml_DoPostBackWithOptions');
        setTimeout(txt,0);

        //event.preventDefault();  
        //or
        //event.stopPropagation();  
    });
 });
Link to comment
Share on other sites

I have some clients that want to use extended functionallity on some designs.

I make different web designs with components and so on.

For every button on this designs, I add on server side onClick event (VCL, no javascript).

But some clients on this design want to change some buttons and extend  functionallity of the buttons.

I think for a way to do this on Client Side without changing VCL code in design.

Is this possible ?

 

Link to comment
Share on other sites

I think I can make add-ons with javascript and instal them on client's browser.

This add-ons will work over loaded application, and dinamically replace or add some buttons functionallity on client side.

Example of this:

1. Client load my web application on google chrome browser

2. Add-on will activate on this point.

3. Add-on will look for known buttons (add-on will search for buttons on design) , if is a found button will add some functionallity on button click, like :
Standard "button.onclick" have ShowMessage ('Hi there') with one button OK

Add-on will found this button and replace message with 'Hi, what we can do for You?' and show more buttons: OK, Close, Back

Link to comment
Share on other sites

4 hours ago, irigsoft said:

I think I can make add-ons with javascript and instal them on client's browser.

This add-ons will work over loaded application, and dinamically replace or add some buttons functionallity on client side.

Example of this:

1. Client load my web application on google chrome browser

2. Add-on will activate on this point.

3. Add-on will look for known buttons (add-on will search for buttons on design) , if is a found button will add some functionallity on button click, like :
Standard "button.onclick" have ShowMessage ('Hi there') with one button OK

Add-on will found this button and replace message with 'Hi, what we can do for You?' and show more buttons: OK, Close, Back

I'm sorry, your case is not very clear to me.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...