• Resolved hsntgm

    (@hsntgm)


    Hello codepeople,

    I want to find first input field which gaves validation error. ( .cpefb_error )

    I stuck in here.I tried so many variation but this code does not scroll to top where is first error in the form.

    
    jQuery(window).scrollTop(jQuery('[id*="fieldname'+'5_"],fieldset2,fieldset3....etc').find(':input[value=""]:visible').not('button').filter(':first').offset().top);
    

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    By default the plugin set the focus in the first field whose validation rule fails, and the browser should scrolling to the field.

    However, if you want scrolling explicitly to the first field whose the validation rule fail, the correct code would be:

    jQuery(window).scrollTop(jQuery('.field.cpefb_error:visible:eq(0)').offset().top);

    Best regards.

    Thread Starter hsntgm

    (@hsntgm)

    This is working code, as usual!

    Thank you codepeople.

    • This reply was modified 7 years, 2 months ago by hsntgm.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Find first visible blank input field in form’ is closed to new replies.