473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1415

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Prabhu Ramachandran | last post by:
Hi, I noticed peculiar behavior under Python-2.3.4 under Win32. When I run something like this: f = open('t.txt', 'wb') f.write('1\012'+'2\012'+'3\012') f.close() f = open('t.txt', 'r')...
4
by: Charlie Cosse | last post by:
Asymptopia Crossword Builder is a JavaScript application. A robust GUI allows users to submit arbitrary length lists of key-hint pairs which can be regenerated an unlimited number of times until...
13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
3
by: griffith | last post by:
I need some rather technical spidering advice, and I'm hoping that this is a good place to find it (and my apologies if this isn't). My site contains pages of images, where each image includes a...
1
by: jphelan | last post by:
I ran a MS Access Analyzer program that suggested changing, "rst.FindFirst strcriteria" to using the, "Seek" instead. I tried making the change. I get a Compile error that says, "Argument is not...
5
by: MLH | last post by:
I have a table I can open as table type recordset or a dynaset. Searching for a particular value in the table's main keyfield, which would be faster and less strain on the application......
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
33
by: Kevin Brammer | last post by:
I'm trying to use seek to check for the existence of a record before saving, so there are no duplicate entries (is there another way?). I have a "groups" table, which has GroupID Island...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.