javascript - jQuery dynamic event binding -


I think this is a very basic question, but I'm struggling with this problem.

On my form I have an option which dynamically adds a new line to the table, which is quite simple to do with jQuery. On any of the elements, I need to force an event, it is relatively simple, the part with which I have problems, is the incident which needs to be bound, it has to be taken parameters. Therefore, I have the code:

  $ (newrow) .find ("select"). Each (function () {var ochange = function (handle) {var thisselect = "select" + handle; var thislink = "link" + handle; var iscollate = "collate" + handle; if (document.getElementById (thisselect). Value == 4) {document.getElementById (thislink) style. visibility = 'visible';} and {document.getElementById (thislink) style. visibility = 'hidden'; document.getElementById (thiscollate) .value = " $ (This). $ (This). $ (This) atr ("name", "select" + numfields); $ (this) .attr ("id", "select" + numfields) ;});  

The event binds as expected, but the "handle" variable does not register (certainly I'm pretty sure this is a false syntax) Also, this function which I used to type in dynamic form I want to bind the element in fact has already been defined, so if there is a method then I can call the pre-defined function (which takes the parameter). I would love to hear about it

The full context for the event object is


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -