469,275 Members | 1,621 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Seek suggestions on making a javascript generating web application

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"),"Enter Data") return false;
return true;
}

(And then something like this ..)

<form onsubmit="Validate(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_date1","Start Date One") ) return false;
}
if (!IsDate(aForm.elements("start_date2"),"Start Date Two") ) {
if (!IsDate(aForm.elements("end_date2","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?
Jul 23 '05 #1
2 1280

"GIMME" <gi*******************@yahoo.com> wrote in message
news:3f**************************@posting.google.c om...
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"),"Enter Data") return false;
return true;
}

(And then something like this ..)

<form onsubmit="Validate(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_date1","Start Date One") ) return false; }
if (!IsDate(aForm.elements("start_date2"),"Start Date Two") ) {
if (!IsDate(aForm.elements("end_date2","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.
Hmmm, I seem to be bottom posting...

Why is that hard? Just add a start and stop date to your form.You can have
your "validate type" rolldown turn the display style on/off for those
textfields.

Parsing the dates is a much harder problem, but you didn't ask about that.

I'd probably skip the linked select boxes and just list all the form
elements and possible validation routines for each. That way you can set all
of them at .

HTH,
Jeff


Any ideas?

Jul 23 '05 #2
Doing what you suggest is easy, but there is a dependency issue
that has to be built in that you are not getting., For example, you
might want to set things up so that some input is not null
only if a start date has been entered. And the start date might be optional.

I'd probably skip the linked select boxes and just list all the form
elements and possible validation routines for each. That way you can set all
of them at .

HTH,
Jeff


Any ideas?

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Prabhu Ramachandran | last post: by
13 posts views Thread by Kai Grossjohann | last post: by
3 posts views Thread by griffith | last post: by
193 posts views Thread by Michael B. | last post: by
33 posts views Thread by Kevin Brammer | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.