|
The problem is in returning the label of the form field with the error. For instance: <LABEL><font color="red">*</font>Effective: <input type="date" name="effDate" size="10" border="0"></LABEL> If the Effective date it wrong, it is simple to alert: effDate is incorrect / blank or <effDate value> is incorrect but it is substantially more difficult to alert: Effective: is incorrect because it is practically impossible to consistently retrieve LABEL form field names (in a for loop or otherwise) because of the format differences between HTML pages/forms. You have to drill through the BOM. -----Original Message----- From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Brad Stone Sent: Thursday, October 02, 2003 3:18 PM To: Web Enabling the AS400 / iSeries Subject: Re: [WEB400] Xforms I don't quite follow. Do you have a for instance? In cases I could see how you'd want to have similar programming for fields (for example error checking a "quantity" type field on 10 different forms would most likely be the same). But, with writing "good" javascript and having a set of base functions, you really don't need to worry if you name the fields the same on each form. Ie: if (!isValidNumber(qty)) and if (!isValidNumber(quantity)) Are both very simple because you have the isValidNumber function available to all HTML forms. You can even take this further writing an isValidQuanity() function that does: function isValidQuantity(number) { return isValidNumber(number) && isGreaterThanZero(number) } I'd much rather do this than worry about parsing XML data streams from forms, and the added complexity that XML adds to any web application (which in this type of case I could say isn't really necessary). I'm sure there are instances where it would be nice, but few and far between. I may have missed what you were trying to say, but I'm all ears. :) Brad www.bvstools.com On Thu, 2 Oct 2003 11:16:33 -0700 "Eric Kempter" <EKempter@xxxxxxxxxxxxxxx> wrote: > There is a good article on this at xml.com > http://www.xml.com/lpt/a/2001/09/05/xforms.html > Per the article, upon submit, the instance data is > serialized as XML and sent to the server. > > What I really like about xforms is that it handles it's > own error checking. While you can use javascript to do > error checking in HTML forms, it is very difficult to > create a javascript error checking script that can work > with all HTML forms. It is practically impossible to > consistently retrieve LABEL form field names because of > the format differences between HTML pages/forms. > _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.