Jump to content
  • 0
blarney

Automatically focus cursor on first field... inline edit report datapage

Question

I'm using a barcode reader to scan an order in a form, passing parameters to another form that scans the product sku, and the 2nd form opens itself up after each sku for however many skus are related to the order. It works well.

 

The sum of the skus scanned by product are in another report datapage that updates on the same page the 2nd form is on. The report queries both the table used to scan skus for a sum by product, and a table containing data from shipping software that contains what should be shipped within it's table....

 

The only issue with this setup is that I'd prefer to get rid of the 2nd form, and just scan the order# , then pass parameters to the report page and use inline edit to scan skus.... the barcode reader hits enter itself with each scan and I have the button hidden...  

 

I can't get this done BECAUSE I can't get the cursor to focus on the inline edit field for skus when the first page opens the report.

 

I think there should be an option for this like there is for forms....but since there isn't, I've been trying a bunch of scripts....here's my latest.... 

Footer:

<script>
{
document.getElementsByName('EditRecordInlineAddlineItemsku').focus();
document.getElementsByName('EditRecordInlineAddlineItemsku').select();
}
</script>

 

Any ideas how I might fix this???

 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
On 4/4/2017 at 0:46 AM, Ba2sai said:

Hi Blarney,

 

Try this:

If your fieldname is "lineitemsku" and you want to focus on this Inline Insert field, try the code below.

<script>
{
document.getElementsByName('InlineAddlineItemsku')[0].focus();
}
</script>

Wow...that worked.

 

I could've sworn that I had tried this already.... but I may have put the [0] in the wrong place. Thank you!!!!!!!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites
  • 0

This code works great for initial load but does anyone know how to make it focus on the form field after each data submission? I need to be able to scan and submit multiple barcodes into a datapage set and it will do it for the first one but not for subsequent ones.

Thanks!

Share this post


Link to post
Share on other sites
  • 0

 

Hi smcdonald83,

Can you try this:


<script>
function SetFocus()
{
    if (!document.getElementById)
    {
        return;
    }

    var nameofthefirsttextfield = document.getElementById("nameofthefirsttextfield");

    if (nameofthefirsttextfield != null)
    {
        nameofthefirsttextfield.focus();
    }
}
SetFocus();
</script>

 

-Franchiser-

Share this post


Link to post
Share on other sites
  • 0

@FranchiserHello, I am looking to do something very similar to this and I wondered if you could please help me? I went to the configure results page and added an HTML block and in the script I wrote:

(my first field is WristbandID)

<script>
function SetFocus()
{
    if (!document.getElementById)
    {
        return;
    }

    var WristbandID = document.getElementById("WristbandID");

    if (WristbandID != null)
    {
        WristbandID.focus();
    }
}
SetFocus();
</script>

 

But nothing seems to happen as a result. Have I done something wrong there or does anyone have any other suggestions?

 

Thanks,


Dawn

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...