Background ...
I've created a web application that allows a user to create an
HTML application from IE.
The application itself creates an XML representation of a XHTML
form. The XHTML representation can be saved as a string and recreated.
(The application also has a crude workflow aspect - so XMHTML forms
can be created and assigned a workflow. Forget I said anything about
the workflow - this is a java/javascript/design question.)
Once the user has created an XHTML form he must create validating
javascript for the input fields he's created. You know, check that
dates are dates, that some fields are not empty, or numeric, or
valid system login-ids. Same thing with select/drop down boxes.
....
I have a proven library of javascript functions to use for validation.
For example, I have functions IsDate() and IsNull() which would
be used in a typical validation function :
function Validate(aForm) {
if (!IsDate(aForm. elements("start _date"),"Start Date") return false;
if (IsEmpty(aForm. elements("must_ have_data"),"En ter Data") return false;
return true;
}
(And then something like this ..)
<form onsubmit="Valid ate(this);"/>
Note that IsEmpty(), for example puts the focus on the current element
and evokes an alert message about the element.
....
I want the user to make javascript validation contingent.
In other words, the end result might be :
function Validate(aForm) {
if (!IsDate(aForm. elements("start _date1"),"Start Date One") ) {
if (!IsDate(aForm. elements("end_d ate1","Start Date One") ) return false;
}
if (!IsDate(aForm. elements("start _date2"),"Start Date Two") ) {
if (!IsDate(aForm. elements("end_d ate2","Start Date Two") ) return false;
}
}
So I need to create a web application (using both JSP(ASP) and javascript)
allowing the user to select a form element, assign it a validation
function, and then to select addtional elements and assign to them
validation functions. As shown in Validate() above.
The thing is. I can't get a grip on how to build the user interface.
I can imagine two multi line select boxes where you click on one select
box, identify an element, and then you populate a multi
select box with names corresponding validation functions for that sort
of element.
But that doesn't take care of the contingency aspect.
Any ideas?
I've created a web application that allows a user to create an
HTML application from IE.
The application itself creates an XML representation of a XHTML
form. The XHTML representation can be saved as a string and recreated.
(The application also has a crude workflow aspect - so XMHTML forms
can be created and assigned a workflow. Forget I said anything about
the workflow - this is a java/javascript/design question.)
Once the user has created an XHTML form he must create validating
javascript for the input fields he's created. You know, check that
dates are dates, that some fields are not empty, or numeric, or
valid system login-ids. Same thing with select/drop down boxes.
....
I have a proven library of javascript functions to use for validation.
For example, I have functions IsDate() and IsNull() which would
be used in a typical validation function :
function Validate(aForm) {
if (!IsDate(aForm. elements("start _date"),"Start Date") return false;
if (IsEmpty(aForm. elements("must_ have_data"),"En ter Data") return false;
return true;
}
(And then something like this ..)
<form onsubmit="Valid ate(this);"/>
Note that IsEmpty(), for example puts the focus on the current element
and evokes an alert message about the element.
....
I want the user to make javascript validation contingent.
In other words, the end result might be :
function Validate(aForm) {
if (!IsDate(aForm. elements("start _date1"),"Start Date One") ) {
if (!IsDate(aForm. elements("end_d ate1","Start Date One") ) return false;
}
if (!IsDate(aForm. elements("start _date2"),"Start Date Two") ) {
if (!IsDate(aForm. elements("end_d ate2","Start Date Two") ) return false;
}
}
So I need to create a web application (using both JSP(ASP) and javascript)
allowing the user to select a form element, assign it a validation
function, and then to select addtional elements and assign to them
validation functions. As shown in Validate() above.
The thing is. I can't get a grip on how to build the user interface.
I can imagine two multi line select boxes where you click on one select
box, identify an element, and then you populate a multi
select box with names corresponding validation functions for that sort
of element.
But that doesn't take care of the contingency aspect.
Any ideas?
Comment