Re: XForms: all CAPS input box

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 14 Jul 98 06:26:12 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Is there an easy way to only allow the user to enter capital letters?

This is kind of a hack but it seems to work. Register an input
filter, copy the string to a temporary, and use toupper().

int filter( FL_OBJECT *ob, const char *old, const char *new, int c )

{

char *new_string = strdup( new );
int i;

for ( i = 0; new_string[i]; i++ )
new_string[i] = toupper( new_string[i] );
fl_set_input( ob, new_string );
free( new_string );

return !FL_INVALID;

}

Refer to the manual for details on Input object filters.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/