Re: [thelist] JavaScript Validation for Pull-Do wn Menus and Radio Buttons — R E S O L V E D

Courtenay court3nay at gmail.com
Fri Dec 10 18:03:09 CST 2004


/^(\s*)([\W\w]*)(\b\s*$)/   is actually a regular expression, which is
not confined to Javascript, but is implemented widely in languages
such as Perl and PHP.

They're difficult to understand at first, but once you get the 'hang'
of it, can be fun for the whole family. (ok, maybe just for grandma)

An excellent site for reference and tutorials is www.regexp.info


On Fri, 10 Dec 2004 18:54:08 -0500, Jono <ox4dboy at comcast.net> wrote:
> 
> On Dec 10, 2004, at 4:23 AM, Andrew Clover wrote:
> 
> > Jono <ox4dboy at comcast.net> wrote:
> >> <SCRIPT LANGUAGE="JavaScript">
> > Time for nit-pick-fun! ;-)
> > <script type="text/javascript"> if you care about validation
> >>     var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
> >>     if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
> > You're trying to strip leading and trailing spaces, right?
> > ...
> 
> Andrew, thanks for the tips, although I have no idea what your
> suggestions mean.  I cannot look at "/^(\s*)([\W\w]*)(\b\s*$)/;" and
> decipher what that means.  I am not too accustomed to writing
> Javascript, I just hack out what I can pick up here and there.  All I
> was trying to do was make sure that users enter info into all of the
> required text fields, checked the required radio buttons, and selected
> an option from the require pull down menus.  I tried to write up a
> tutorial type lesson in my last post (at the bottom), in case someone
> like me came along in the future with the same question, and is swift
> enough to search the archives.
> 
> It would be great if someone (hint, hint) wrote a VERY EASY to
> understand tutorial on the correct way to implement Form field (all
> types of form elements) validation.  I did not find anything easy to
> follow online, but  I only had a few hours to research and get it done.
>   Dreamweaver has a WYSIWYG method to set up field validation, but it
> only seemed to work for text fields?
> 
> 
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list