-1

I use Symfony to generate a form in witch i use jquery stepy and bootstrap formvalidtion. i want to handle jquery click function for some field of my form but it seems that nothing is happening. this is the jquery call :

$( "#myFieldId" ).click(function() {
            alert( "Handler for .click() called." );
        });

I checked that the field id exists once in the form. Please some help.

Anas
  • 11
  • 3
  • 2
    Help? You should provide a reproducible demo. I guess you are just trying to bind the click event before the DOM is loaded. – nicael Jun 14 '16 at 18:10
  • the problem is when i add an inut field i can access the field. Secand i have tried $( "#myFieldId" ).on( "click", function() { alert( $( this ).text() ); }); with no change – Anas Jun 14 '16 at 18:18

1 Answers1

0

It seems that the click event was blocked by the formvalidation api. I've tried

    $('#fos_user_registration_form_ncin').unbind('click').click(function(){
alert("hello");
});

and this work for me. Thank you nicael.

Anas
  • 11
  • 3