Bob Munck wrote:
(and thanks to everyone else who pitched in a tip, it all came down to the
use of [ and ] to sandwich the variable)
> > <input type="text" name="thing_1_deluxe" value="">
> > <input type="text" name="thing_2_deluxe" value="">
> > <input type="text" name="thing_3_deluxe" value="">
> >
> > function copy_business_address(address_type_ID){
> > form.thing_number_deluxe.value = "joey";
> > }
> >
>
> form["thing_"+number+"_deluxe"].value = "joey";
>
> I don't know what the parameter "address_type_ID" is about,
> as I think you intended the parameter to be "number."
> That's what I assumed.
Thanks Bob, this worked. I don't quite understand why it works, though. My
logic would be:
form.["thing_"+number+"_deluxe"].value = "joey";
with a dot (.) after form, but I tried that and it didn't work. I guess
javascript replaces the first [ with a dot? If so, why doesn't it replace
the 2nd one? I tried:
form["thing_"+number+"_deluxe"]value = "joey";
with no dot after the ], but it generates an error. Hmm.
An addition to this code, to make it work in stinkin NS4 with it's crappy
javascript implementation (compared to IE, from my experience so far), is to
add document. before form:
document.form["thing_"+number+"_deluxe"]value = "joey";
I tried your "cute trick" (below) and isn't that snazzy! Sure would be nice
to be able to write text to a particular spot on the page, other than into a
text box, on ALL browsers. I can't wait until browsers start entering the
20th century and we can start developing better interfaces! ;-)
> Cute trick:
>
> <FORM ID=ff>
> Enter text with HTML tags here:
> <TEXTAREA NAME=notes COLS=64 ROWS=6 WRAP
> ONKEYUP="document.all.rendered.innerHTML=ff.notes.value">
> </TEXTAREA></FORM>
>
> <P>Your text will look like this:
> <DIV ID=rendered STYLE="padding:8pt;border:4;border-style:inset;"> </DIV>
>
> As you type HTML into the textarea, what you've typed appears
> in rendered form in the DIV box below it. Nice for things like
> message boards or input to be used to generate a web page, but
> works only in MSIE 4 or better, as is so often the case.
"As is often the case".
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.
---------------------------------------------------------------------