Input Validation

Input Validation

  
i have an input box associated with an Integer variable.

i want do disable\ don't allow users to type text , only Integer numbers (0 to9)

how can i do it? is there any way that Platform auto validates this?

The fiedl is mandatory
as as no null Value,

Tks

Nuno Cachinho
Hi Nuno,

A) Using server side logic: TextToDecimalValidate() or TextToIntegerValidate() built in actions.
B) Using client side logic (JavaScript):

B.1) On extended properties of your input box: ExtendedProperty: onkeypress   ExtendedValue: "return IsDecimalKey(event);"
B.2) On WebScreen JavaScript: Put the code below:

function IsDecimal(e)

{if(!e)

e=window.event;var code;if(e.keyCode)

code=e.keyCode;else

{if(e.which)

code=e.which;}

if(!((code>=48&&code<=57)||(code>=96&&code<=105)||code==8||code==9||code==37||code==39||code==46||code==190||code==110||code==46||code==13||code==16||code==35||code==36))

{return false;}}



Regards,
Rafael Pereira

I have tried the  valid atribute.

and in this case:

if the input box is related with a integer why this is still valid even if i put others charecters?

I Solved it.


in Button "validation"  Properties i had:

On Click/ Validation = (none)

I have change it to Server.

Then i have changed the Web Validatioon Messages\Invalid Integer to a nice feedback.

hope this is works for other to.