⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Set length



Димитър Андреев

Димитър Андреев
  • profile picture
  • Member

Posted 25 November 2015 - 15:19 PM

Hello , I want to ask , I have a column of protocol in it are inserted data "1" , "2" , "3" ... I want to table them show to me as follows: " 0000001 ", " 0000002 " .. . " 0000010 .... ie length always has 7 digits ! can you advise me if he could do such a thing?

Thanks in advance !

 

P.S. Sorry for my bad English! :)

 

Sorry , I messed up the place !


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 24 December 2015 - 05:11 AM

Hi Димитър Андреев

There is a simple solution to the same, you need to write the javascript for it that can act upon the on change event of the field(s) you want to target. On change of the same, pad the value with preceeding 0's as per your requirement. 

The same script can then be included in the GC using set_js function call. But 1 thing - mind it, rather then using $.ready i will recommend the old style javascript way of calling window.onload -- why, the new js u add is added much before the template of gc is rendered. If it dose not have jquery loaded before this script of yours is loaded, it will eventually end up giving error. 

 

Happy GCing :)