Need object-oriented error reporting mechanism

9 views
Skip to first unread message

Victor Porton

unread,
Sep 7, 2012, 9:49:43 AM9/7/12
to perl-for...@googlegroups.com
I am now faced with the following problem:

The user should enter his personal data and description of several texts (each description of a text containing several input fields).

At each moment of time maximum one text is displayed (the rest are "display:none").

A text should be validated with JavaScript in two cases:
1. submission of the form;
2. switching to an other text.

So naturally it arises the need to make validation of a text a JS function, as we need a function to call the same code from multiple places. Now it cannot be well done as we need to pass multiple parameters: invalid, alertstr, invalid_fields (and maybe others).

I propose for a future version of FB to make the validation sub-function to accept one object as the parameter. This object should contain all variables which the validator may need to alter.

There should also be the backward compatibility mode (we probably should make the backward compatibility mode the default).

--
Victor Porton - http://portonvictor.org
Reply all
Reply to author
Forward
0 new messages