Re: XForms: input filter

Tristan Savatier (tristan@mpegtv.com)
Mon, 23 Mar 1998 02:37:26 -0800

# To subscribers of the xforms list from Tristan Savatier <tristan@mpegtv.com> :

Graham Smith wrote:
>
> # To subscribers of the xforms list from Graham Smith <gqs@zip.com.au> :
>
> Hi All,
>
> I am having trouble setting up an input filter using the function
> fl_set_input_filter( ) and was wondering if somebody would be kind enought
> to send me an example using this function.

This one is for entering an hex number.

static int
registration_key_filter(
FL_OBJECT *ob,
const char *old,
const char *cur,
int c
)
{
if (isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) {
return FL_VALID;
} else {
return FL_INVALID | FL_RINGBELL;
}
}

-t
_________________________________________________
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/