• Resolved hsntgm

    (@hsntgm)


    Hello codepeople !

    I realised that .fosuc() doesn’t work on hidden input fields. I have a formula when tickbox selected it assigns some values to hidden input fields i have to .focus() these hidden input fields because they are part of calculation also this situation affects my form validation too. When user click next button my form gives error because field still not valid.

    I couldn’t solve that myself.

    Thanks.

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

    (@codepeople)

    Hello,

    If you want scrolling to the position of the hidden field, for example, to the fieldname1, you should find the closest visible parent:

    jQuery(window).scrollTop(jQuery('[id*="fieldname1_"]').closest(':visible').offset().top);

    Best regards.

    Thread Starter hsntgm

    (@hsntgm)

    Hello,

    Ok i think there is misunderstanding about this issue because of me and my complex form structer.I don’t want to scroll anything.It has already resolved by you. Thanks again !

    I mean, I can’t .focus() hidden input fields which has display:none css property.

    First, i need to focus these fields because they take ‘valid’ class after focus and my form valitadion depends hasClass(‘valid’). So user get error when click continue

    Second, in my form structer if user select a tickbox it assign values to inputs I mean all inputs :visible and :hidden after that if user make :hidden inputs to :visible (this is possible, for example add new room button makes 3 hidden inputs field to visible) the previosly assigned value must be focused because this field is part of equation so it doesn’t trigger correctly.

    Simply, i could not find any solution to focus hidden input.

    Thanks.

    • This reply was modified 7 years, 9 months ago by hsntgm.
    Plugin Author codepeople

    (@codepeople)

    Hello,

    You cannot set the focus in hidden fields in some browsers, please, look the browsers and jQuery documentation, specifically the yellow frame in the following link:

    https://api.jquery.com/focus/

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to focus hidden input field’ is closed to new replies.