Bob Munck wrote:
>
> > >     form["thing_"+number+"_deluxe"].value = "joey";
> >
> > ... I don't quite understand why it works, though.
>
> It works because "form" is an associative array of the elements
> in the form.  The references
>
>       form["thing_"+2+"_deluxe"]
>       form.thing_2_deluxe
>       form["thing_2_deluxe"]
>
> are equivalent.

<snip explanation>

Thanks, Bob, your explanation makes sense. I hadn't thought about it this
way. Appreciate it.

Is there a way to do something like this:

        var variable_name = 2;
        form.thing_[variable_name]_deluxe.value;

for efficiency's sake?

> > I tried your "cute trick" ... and isn't that snazzy!
>
> One of my uses of it is a form that is processed by a PERL
> CGI program to create a web page.  I can show the user filling
> out the form exactly what the web page will look like
> dynamically, avoiding the round-trip to the server.  My
> JS code gets values from other elements in the form and
> applies the method ".replace(/\n\r/g,'<P>')" to the text
> (replacing blank lines with <P>) before assigning it to
> the DIV .innerHTML.

I think you're saying you have a page setup where the user types (or
pastes?) a bunch of text into an <input=text> or <textarea> and it is
rendered elsewhere on the page where the DIV .innerHTML is, right? This
would allow a user to enter some html in the textarea and see how it would
look by looking at the part of the page where DIV .innerHTML is happening.
Nice idea for "live edits" that can be previewed prior to saving. I'll
surely make a note of this technique, because I build quite a few "admin"
modules that allow people to edit their pages (stored in db's).

> > would be nice to be able to write text to a particular spot
> > on the page, other than into a text box,

<snip>

> > on ALL browsers.
>
> Aye, there's the rub.  As far as I know this is all legal
> W3C ECMAScript and DOM, but Microsoft is the only browser
> that come even close to supporting the standard.  This is
> the reason that I recently expressed my regret at the rabid
> anti-Microsoft tone of many of the messages on this list.
> Of course, I was immediately blasted for daring to suggest
> that the Evil Microsoft could ever do something right.

I agree with you on MS and the browsers. As far as versatility with CSS and
javascript, from my experience, IE4 has been a better package to develop in.
I haven't done much with DHTML, so can't comment on that. I also have found
IE4 to be more stable than any of the v4 NS releases, but I haven't tried
NS4.5 yet. NS3 *was* very solid, though.

MS also makes available a plethora of dev tools, beyond the browser...and
they have a large suite of apps that have "interworking" components...which
will work between MS apps and outside them. Granted, there are things like
this on other OS's, but I ain't knocking the plethora. Sheesh, you wouldn't
believe the grief Allaire got when people found out they decided in favor of
an MS component for their Homesite 4 product! They defended their position
by basically saying, "look, no other vendor has this and to write it from
scratch would be to reinvent the wheel, so why bother...just so we can say
we "aren't" using an MS product? Fooey!"

I don't have any interest in starting a holy war...I certainly think MS has
done some nasty things...but I don't mind giving them credit where it's
appropriate.

Jack

____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to