[Top] [Prev] [Next] [Bottom] [Contents]

SaJavaCallFunc

Prints a Java Script function call to one of the Java Script validation functions supported by Sapphire.

Synopsis

#include "sajavasc.h"
int SaJavaCallFunc(int kind, char* arg1, char* arg2);

Argument

kind
Specifies which Java Script function(s) to print. Valid defined constants and the Java Script function they call are:
SAJS_DATENOW - SaValDateFixNow()
SAJS_FORMAT - SaValSimpleFormat()
SAJS_NOEMPTYFLDS - SaNoEmptyFields()
SAJS_CREDIT - SaValCreditFormat()
SAJS_ZIP - SaValZipCodeFormat()
SAJS_SSN - SaValSSNFormat()
SAJS_EMAIL - SaValEmail()
SAJS_STATE - SaValState()
SAJS_LETTERS - SaIsAllLetters()
SAJS_DIGITS - SaIsAllDigits()
SAJS_NOBLANK - SaIsFieldNotBlank()
arg1
A string argument used as the first argument to the Java Script call. The variable kind depends on the value of kind. Most take a string (usually the value of a text field). However, SAJS_DATENOW assumes the argument is a text field, and SAJS_FORMAT assumes it is a form.
arg2
A string argument used as the second argument to the Java Script call. Only a value of SAJS_FORMAT for kind uses this argument. In this case the argument is usually a literal string. You must properly escape the " and \ characters when calling this function with a string literal (use \ to escape these).

Return Values

Returns 0 on success. Returns 0, if arg1 is NULL or empty, if kind is not one of the defined constants, or if arg2 is NULL or empty for those values of kind that use that argument.

Description

Prints a Java Script function call to one of the Java Script validation functions supported by Sapphire.

Example

The code fragment:

SaJavaCallFunc(SAJS_FORMAT, "theForm.TextField1.value", 
"\"##-??\"");
will write the following string to standard out:

\tif(!SaValSimpleFormat(theForm.TextField1.value, "##-
??"))\n\t\treturn false;\n\n

See Also

SaJavaSsnCheck, SaJavaZipCheck, SaJavaCardCheck, SaJavaNoEmptyFields

SaJavaDateFixNow, SaJavaIsAllDigits, SaJavaIsAllLetters, SaJavaIsFieldNotBlank

SaJavaValEmail, SaJavaSimpleFormat, SaJavaState, SaRegJsScripts, SaJavaCallFunc



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.