Field Validation in a Form 
Author Message
 Field Validation in a Form

Using cw5B ABC templates.

Placing a tick in the Required attribute of a field and the OK button traps
an error,  as specified in the dictionary, when the OK button is accepted
with focus returned to the field that has the error. However I would prefer
to display a message as to what the error is prior to selecting the field in
question. This is necessary as often the dictionary validation rules are not
specific enough. I would have thought that embedding the following code in
the OK button  (accepted before generation) would suffice:

IF MyField = ''
    MESSAGE('Field not entered')
    SELECT(?MyField)
    CYCLE
END

If the "required" attributes are ticked the message is not displayed - code
appears to be by passed. If they are unticked the message is displayed but
then the field is not selected and a record is added to the file thus
defeating the validation objective.

What is the most desirable way of achieving field validation and where
should the code be placed.

Many thanks

--
Derek M Henderson
Cash Controller
KwaZulu Natal
South Africa



Sun, 30 Nov 2003 19:48:51 GMT  
 Field Validation in a Form
Derek

What I do is put the validation code in the field Accepted embed under
Perform field level validation. Make sure that you also use
?yourfield{prop:touched} = 1 in the field Selected embed to ensure the code
is executed if the field is skipped and they just hit the OK button. HTH

Larry Hurlbert
SBWA Local 125
Using: C5PEb, ABC Templates, FM2, Secwin, CPCS


Quote:
> Using cw5B ABC templates.

> Placing a tick in the Required attribute of a field and the OK button
traps
> an error,  as specified in the dictionary, when the OK button is accepted
> with focus returned to the field that has the error. However I would
prefer
> to display a message as to what the error is prior to selecting the field
in
> question. This is necessary as often the dictionary validation rules are
not
> specific enough. I would have thought that embedding the following code in
> the OK button  (accepted before generation) would suffice:

> IF MyField = ''
>     MESSAGE('Field not entered')
>     SELECT(?MyField)
>     CYCLE
> END

> If the "required" attributes are ticked the message is not displayed -
code
> appears to be by passed. If they are unticked the message is displayed but
> then the field is not selected and a record is added to the file thus
> defeating the validation objective.

> What is the most desirable way of achieving field validation and where
> should the code be placed.

> Many thanks

> --
> Derek M Henderson
> Cash Controller
> KwaZulu Natal
> South Africa



Tue, 02 Dec 2003 02:59:46 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Validation of FORM fields

2. Cyclic Form Question - checking form fields provided?

3. Start with a field on a form other than the first field

4. HTML Form data validation with Object REXX (Windows)

5. Date validation of input from HTML form

6. newbie with a php validation form mail script problem

7. clientside validation of checkboxes from PHP form

8. Form validation q

9. form validation

10. Form Validation

11. Form validation and page navigation

12. Form validation problem: URGENT

 

 
Powered by phpBB® Forum Software