You'll have to access the fields by element ID.
document.theformname.elements[id].properties
document.theformname.length is the number of elements in the form.
The elements go in order starting at 0.
-Mike
At 09:07 AM 8/22/2001 +0200, you wrote:
>This is easy. My problem is that I need to work with this variable (array)
>also in JavaScript !! So I have test[1]........test[5] in PHP but how can I
>get values from this variables in JavaScript ? I know this is little off
>topic but I spent already whole day on this with no luck so far !!
>
>DAN
>
>-----Original Message-----
>From: Mike Flynn [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, August 21, 2001 4:48 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-WIN] Re: Array
>
>
>Alternately, though I think the array solution is probably the most
>durable, you could also do it as such:
>
>for ($i = 1; $i<6; $i++) {
> print "<input type=\"text\" name=\"test$i\">\n";
>}
>
>and then retrieve them as $test1 thru $test6, or if you want to use a loop
>like this:
>for ($i = 1; $i < 6; $i++) {
> $thevariable = "test$i";
> $thevalue = $$thevariable;
>}
>
>At 03:36 PM 8/21/2001 +0200, Darvin Andrioli wrote:
> >Change your code in:
> >
> > <?
> > for ($i=1; $i<6; $i++) {
> ><input type="text" name="test[$i]">
> >}
> >?>
> >
> >You will obtain an array, named test, with 5 elements.
> >
> >Bye
> >
> >Darvin
> >
> > > -----Messaggio originale-----
> > > Da: Sichta Daniel [mailto:[EMAIL PROTECTED]]
> > > Inviato: martedi 21 agosto 2001 15.15
> > > A: [EMAIL PROTECTED]
> > > Oggetto: [PHP-WIN] Array
> > >
> > >
> > > Hi there !!
> > > cfg: php4.0.4pl1, w2k, apache 1.3.20
> > > Situation:
> > > <?
> > > for ($i=1; $i<6; $i++) {
> > > <input type="text" name="test">
> > > }
> > > ?>
> > > This is all in one form. How can I get all five values of test from this
> > > kind of code ?
> > >
> > > DAN
> > >
> >
> >--
> >PHP Windows Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> -=- Mike Flynn - Burlington, VT -=-
>[EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood *
>the classic example of liberal, consensus, win-win,
>Clintonesque, spin doctor, sell-out, cultural appropriation,
>commodification of dissent type event in the world today
> (-BBB)
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
-=- Mike Flynn - Burlington, VT -=-
[EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood *
the classic example of liberal, consensus, win-win,
Clintonesque, spin doctor, sell-out, cultural appropriation,
commodification of dissent type event in the world today
(-BBB)
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]