You are viewing limited content. For full access, please sign in.

Question

Question

Page scrolls to the top when a Field with Javascript gets the focus

asked on February 9, 2015

I have a form with a JavaScript to add some text values to some fields & to calculate the sum for others. When the user presses tab key and reaches the fields with JavaScript attached to it, the page scrolls to the top. 

Note that he presses again tab key to get to the next field that doesn't have JavaScript the page scrolls to the right place. And when i removed the JavaScript everything is OK. This happens only in the approval phase after starting a process.

What can I do in such a case?

1 0

Replies

replied on February 10, 2015

Can you attach the javascript that you're using? It's hard to troubleshoot without seeing the code.

0 0
replied on February 10, 2015
var textAR = ["خصم", "خصم", "خصم ", "خصم ", "خصم ", "خصم", "إجمالي", "الصافي"];
  var textEN = ["deduction", "deduction", "deduction", "deduction", "deduction", "deduction", "deduction", "Net"];
  

$(".calculateButtonF5").click(function() {
    $('#q255 tbody tr').each(function (i) {
      $(this).find('.titleAR input').each(function () {
        $(this).val(textAR[i]);
      });
      $(this).find('.titleEN input').each(function () {
        $(this).val(textEN[i]);
        i += 1;
      });
    });
});

In the JS i am adding text into 2 columns of 6 columns .. when the tab sequence reaches those two columns the page scrolls to the top 

Note the weird thing that in preview its working perfect, but when published it goes wrong.

1 0
replied on February 16, 2018

any success in figuring this one out?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.