Hi all,
I need to validate that in a texfield, the user on type characters, I mean (100k, 80k, ect), numbers with text values.
if the user enters 10k,20k like in textfield, I have show some validation message,How could I achieve this,
is there a special functions?
Can anyone help me please on priority?
Discussion posts and replies are publicly visible
Try this:
a!localVariables( local!a,a!textField( label:"Number Only", value:local!a, saveInto: local!a, validations: if(a!isNullOrEmpty(stripwith(local!a,"0123456789")),"","validation"),))
I have done like this,still it not working,Could you suggest?
a!textField( /*label:"Market Value"*/ value: rule!CR_FN_setDecimalValues( value_dec: index(fv!item, "marketValue_dec", {}), decPlace_int: 2 ), saveInto: { fv!item.marketValue_dec, a!save( fv!item.discountedValue_int, rule!CR_APP_FN_getDiscountedValueFromMarketValue( crREFCollateral_cdt: local!rowREFCollateral_cdt, marketValue_dec: fv!item.marketValue_dec ) ) }, readOnly: local!releaseDeleteReadOnlyBool, required: rule!CR_APP_FN_requiredConditionsForDocumentaionUnit( crAppSelectedItem_cdt: fv!item, role_txt: ri!role_txt, isRequired_bool: ri!isSecurityCollateralReq_bool ), validations: {rule!CR_FN_setValueGreaterThanZeroValidation(value_dec: fv!item.marketValue_dec), if(a!isNullOrEmpty(stripwith(local!marketValue,"0123456789")),"","Enter a valid number"), } )
I don't see any values saved to local!marketValue, which you have used in the stripwith function. In case of decimals, add a decimal point also in the with parameter value of stripwith function.
I have defined the local var above