جزء من رمز JS كما يلي:
الوظيفة checkInputIntFloat (oinput) {if (''! = oinput.value.replace (// d {1 ،}/. باطل ؟ '': oinput.value.match (// d {1 ،}/. {0،1}/d {0 ،}/) ؛ }}رمز الجزء HTML (مثال):
<type type = "text" id = "input1" name = "input1" onKeyup = "javaScript: checkInputIntFloat (this) ؛" />