Page 1 of 1

Strip Leading Zeros

Posted: Sat Mar 07, 2009 7:19 am
by warrenk
What is the easiest way to strip leading zeros from a numeric field?

ie. 00009 should be 9

Thanks for any help!
Warren

Posted: Sat Mar 07, 2009 8:45 am
by FourthWorld
Hmmm...apparently adding zero works pretty quickly:

put 0+000009

Posted: Sat Mar 07, 2009 2:08 pm
by warrenk
Thanks Richard....that was a easy solution!

Appreciate your help!
Warren

Posted: Sat Mar 07, 2009 4:40 pm
by Philhold
I was watching this thread hoping that it would answer a question I've been trying to answer myself. How do you actually apply input validation/input aids in Runtime Revolution?

In Javascript if I wanted to change the contents of an input field to all upper case I would put this in the field tags.

onChange = "toupper(this)"

and this elsewhere on my html page.
<script type = "text/javascript" language ="javascript">

function toupper(myObject){
myObject.value = myObject.value.toUpperCase();
}

</script>

Lets say I rewrote that in Transcript how would I apply it to a field and what would I use to trigger the function?

Many thanks

Phil

Posted: Sat Mar 07, 2009 5:46 pm
by HankT
Philhold wrote: how would I apply it to a field and what would I use to trigger the function?
Put this in the field's script

Code: Select all

ON closeField
    put toupper(me) into me
END closeField
Leaving the field by tabbing out, clicking in another field, etc, would trigger it.

Hank

Posted: Sat Mar 07, 2009 5:54 pm
by Philhold
Hi Hank,

Brilliant! Many thanks.

Where can I find a list of even handlers and what objects they apply to?

Cheers

Phil

Posted: Sat Mar 07, 2009 5:57 pm
by HankT
Philhold wrote:Where can I find a list of even handlers and what objects they apply to?
The Dictionary, under the Help menu.

Hank

Posted: Sat Mar 07, 2009 6:53 pm
by Philhold
Hi Hank,

I meant to say "event".

I'll have a dig in the Dictionary.

Cheers

Phil