[thelist] testing for empty in javascript or vbscript

Tom Dell'Aringa pixelmech at yahoo.com
Mon Jul 15 17:51:13 CDT 2002


Marc's solution = much better. I would do it that way.

Tom
--- Marc Seyon <seyon at delime.com> wrote:
> Message from Tom Dell'Aringa (7/15/2002 03:29 PM)
> >Do you have a code snippet? Anyway, you could do something like
> this.
> >Have all your boxes named something like box1, box2 etc. Then
> >
> >for(i=0; i<=16; i++)
> >{
> >    box = "box" + i;
> >    if(document.getElementById(box).value = "")
> >       {
>
> You don't have to have them all named similarly. Nor even have all
> as
> checkboxes.
>
> You can refer to any form element thusly
> document.formname.elements[i]
>
> And if you wish, even check whether the form element is a checkbox
> document.formname.elements[i].type == 'checkbox'
>
> With that, as Tom says, it's easy to iterate through with the for
> loop.
>
> Hope this helps.
> -marc
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



More information about the thelist mailing list