Re: How to wire click event with argument when create input



On Jun 22, 5:10 pm, quoclinh <lequocl...@xxxxxxxxx> wrote:
Hi,

I have the following function that works. It would create an input
that would invoke a click event that call a javascript function:
[...]
btn.onclick = execAction; //this works
[...]

The question is, if I have an execAction function with an argument,
how do I change the code in createButton to accomodate it?

btn.onclick = function() {
execAction(arg1, arg2, ...);
}

Incidentally, if you want a function that fires when a form is
submitted, you are much better off to put it on the form's onsubmit
handler rather than the submit button's onclick handler.


--
Rob

.



Relevant Pages

  • Re: .Net Remoting UserControl as Object in HTML page
    ... > Hi Sunny, ... > am not getting the events in my HTML. ... sure if this is the right way to invoke a javascript function on the ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: PostBack Event
    ... returning a value of 'False' to an onClick handler will stop anything else from executing ... __doPostBack would never be called in this onClick handler. ... > The requirement is that if the javascript function returns false, ... > don't want the Postback event to execute. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Invoke JS function from extenal application
    ... > model of the document in the browser. ... >> Let's say we have a web page with a javascript function called ... >> Then in a windows app, I have a form with a textbox and a button. ... >> 2) I would like to invoke the javascript directly (i.e. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Javascript call
    ... Technology: ASP.NET 2.0 ... Language: C#.NET 2.0 ... How do I invoke a Javascript function as soon as the Web Page ...
    (microsoft.public.dotnet.framework.aspnet)
  • Invoking javascript function from IHttpHandler
    ... I am trying to invoke a javascript function from IHttpHandler using ... The following snippet is called from ProcessRequest ...
    (microsoft.public.dotnet.framework.aspnet)