ASM said the following on 5/11/2006 12:02 PM:[color=blue]
> Randy Webb a écrit :[color=green]
>>
dhughey@gmail.com said the following on 5/11/2006 11:27 AM:
>>[color=darkred]
>>> To Be More Clear, here is all of the code I am using. See
>>> CHANGE_WITH_RADIO_SELECTION to see what I need to change with radio
>>> selection.[/color]
>>
>>
>> document.forms['formID'].elements['oldNameHere'].name = "newNameHere";[/color]
>
> and nextime ?
> how to call back oldNameHere ?
> (supposing location in a frame or other window)[/color]
Then you can check the state of the Radio buttons to determine what the
name of the text input is. Or, you could save a reference to it. Or, you
could use the form index (as you did).
Yours suffers drawbacks as well if the author inadvertently adds a new
input before the desired one.
They both suffer, it is just a matter of which way you want to try to
protect yourself.
The simplest solution to it all is to simply hard code both fields that
are needed for the search engines and then use script to duplicate data.
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/