|
<< Click to Display Table of Contents >> Navigation: Telegram > 2019 > 10 > 23 > Telegram_2019-10-23T16 |
2019-10-23T16:00:21
In the Scripts property of the button?
2019-10-23T16:02:04
you can use the JavaScript of the form to declare this function
2019-10-23T16:04:03
and the function
CallSomeWeirdCodeInSome3rdParyJavaScriptLibrary();
is provided by you (this one does the other stuff that you need).
It can be inside a JS file, it can be declared in some other JS library, or it can also be provided by your in your IWForm's JavaScript property (I don't recommend this if this needs to be changed by some external web designer, without rebuilding the application)
2019-10-23T16:06:21
this way you decouple your server code and your JavaScript code. You just have to define a protocol. The protocol in my example is function
CallSomeWeirdCodeInSome3rdParyJavaScriptLibrary();
2019-10-23T16:06:49
Someone provides this function to do whatever you want, from on the browser side. Your only obligation is to call it when the button is clicked.
2019-10-23T16:06:53
that's how it should be done
2019-10-23T16:06:54
IMO
2019-10-23T16:07:41
the JavaScript doesn't need to know that your button is named Button1 or MyFrame_Button1
2019-10-23T16:07:46
that's the point
2019-10-23T16:08:13
It just needs to implement a function which needs to be called with the appropriate parameters. That's how you build a protocol
2019-10-23T16:32:14
Ok, sounds good. But I still don't understant how can I add a \question\ before button click in this way. Sorry here it's late...
2019-10-23T16:32:33
Small example?
2019-10-23T16:33:47
the question doesn't go in the button click
2019-10-23T16:33:54
it goes into the other function
2019-10-23T16:34:38
so the other function is an ajax callback
2019-10-23T16:35:33
to create an example I need to know what you are doing there. I have no idea
2019-10-23T16:35:38
no it is not
2019-10-23T16:35:45
the other function is a javaScript function
2019-10-23T16:49:44
type: mention @sonjli You use templates?