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

Question

Question

upperCase script doesn't seem to work in multi-row tables

asked on May 4, 2015

Although I have been using the upperCase JavaScript someone provided for me, I haven't been able to get this to work with a table where the user is able to add rows.  Although everything typed in the first row is being converted to upper case (when tabbing off of these fields), the same doesn't happen for subsequent rows in the table.  I have tried specifying the upperCase CSS class both in the table, as well as the individual rows, but only the items in the first rows of the table are being converted.

For reference, this is what I'm using for the upperCase script at the moment:

$(document).ready(function(){
$('.upperCase input').focusout(function() {
  $( this ).val($( this ).val().toUpperCase());
  });
});

Thanks to anyone who might be able to help!

Marty Gaffney - Network Technician

Town of Okotoks

0 0

Answer

SELECTED ANSWER
replied on May 4, 2015

You can use this JavaScript:

$(document).ready(function(){
  $('.upperCaseTable').on('change','.upperCase input', function() {
    $('.upperCase input').focusout(function() {
      $( this ).val($( this ).val().toUpperCase());
    });
  });
});

Give the table the CSS class upperCaseTable and keep the CSS class upperCase for the columns in the table.

0 0

Replies

replied on May 4, 2015

That did it - thanks a bunch!

Marty

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

Sign in to reply to this post.