Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
835
Showing Leading Zeroes in WebNumericEdit
posted

It seems that it should be simple, but I'm being challenged by trying to display a number in WebNumericEdit in a fixed format containing 4 digits with leading zeroes.

 In reviewing another post, it implied that putting code in the ValueChange event to set the value of the object would work, but it doesn't.  Here's what I do:

function ValueChange(oEdit, oldValue, oEvent) {
var txt = "0000" + oEdit.elem.value;
oEdit.elem.value = txt.substr(txt.length - 4)}

This seems to have no affect.

 Suggestions?

Thanks...Steve

Parents
No Data
Reply
  • 24497
    posted

    Hi Steve,

    Access to elem.value is not supported. Set may destroy control.

    If you use integer only, then the best you can do is to use WebMaskEdit with InputMask "0000", DisplayMode=Mask and Pad/Prompt/EmptyPositioChar set to 0.

    On server you may convert value-string to number.

Children
No Data