Monday 15 August 2011

javascript - How can I apply a function containing $(this) to range of selectors? -


I have a small issue that I want to validate a form using the generic function for all inputs on the form. The function handles the complexities of different types of inputs, etc.

The call to the function looks as follows:

$ (": input [type = 'text']"). Stain (function () {validateMe ($ (this) .attr ("id"), button_arri);});

The problem here is that $ (this) only applies to the first element "Blurred", so that on any blurred event that occurs after the first time The first selector is blurred, if he has any meaning?

button_r part has no results. What is a way to implement $ (this) to each element in a collection specified by $ (": input [type = 'text']")? ?

Thanks for any help!

I mean you are guessing:

  $ ("Input [type = 'text']). (Function () {$ (this) .blur (function () {validateMe (this.id, button_r);})}};  < / Pre>  

No comments:

Post a Comment