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

Question

Question

Use Javascript to take last 5 digits from 15 digit field to enter into hidden field?

asked on August 4, 2016

I am attempting to take the last 5 digits from a 15 digit number that the user of the form will enter in and use those last 5 to fill a hidden field to be used for the template and our records tracking. 

I have tried some versions of codes that have been posted here already and have not had any luck. This is what it looks like right now.

I need the last 5 digits from field52 to enter into field 53. and I am quite stuck.

 

Thanks in advance.

0 0

Answer

SELECTED ANSWER
replied on August 4, 2016

See this thread for an example of how to achieve this.

$(document).ready(function () {   
  $('#Field52').on('change', function() {
    $('#Field53').val($(this).val().substr($(this).val().length - 5));
  });
});
1 0

Replies

replied on August 4, 2016

Thank you so much! I dont know how I missed that thread!

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

Sign in to reply to this post.