Counting characters in input box

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Counting characters in input box

ChrisSpeare
Is there a way for xforms to count the number of characters in an input/textarea.  The reason being the XSD of my form limits to 0..35 characters, and don't want someone scratching their head thinking why isn't this valid - could put a warning beside it, but then they have to count the number of chars they use.
Reply | Threaded
Open this post in threaded view
|

Re: Counting characters in input box

Daniel E. Renfer
Chris,

You probably should be able to bind to a separate instance using a
calculate to call string-length() on the content of your textarea. You
could then output the content of that instance to give the user a
"character counter" You'll probably need to make it incremental, so
that it updates in (as close as possible to) real time.

This is all untested, but it seems like it should work.

--
Daniel E. Renfer
http://kronkltd.net/

On 6/21/07, ChrisSpeare <[hidden email]> wrote:
>
> Is there a way for xforms to count the number of characters in an
> input/textarea.  The reason being the XSD of my form limits to 0..35
> characters, and don't want someone scratching their head thinking why isn't
> this valid - could put a warning beside it, but then they have to count the
> number of chars they use.
> --
> View this message in context: http://www.nabble.com/Counting-characters-in-input-box-tf3958941.html#a11233767
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws