Re: using a variable in a JS dot notation string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



echo "document.voteForm.{$tempVar}[0].checked";
echo 'document.voteForm.'.$tempVar.'[0].checked';

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Ron Herhuth" <Ron.Herhuth@tatumpartners.com> skrev i meddelandet
cf6101c3e4e1$94f95a90$f25d2981@tatumlink.com">news:cf6101c3e4e1$94f95a90$f25d2981@tatumlink.com...

I have a Javascript function in my PHP page that I need to plug a variable
into, and for the life of me I can't figure out how to do it.

This is the hardcoded version that works:

rBvalue = document.voteForm.Test_Amendment_One[0].checked

In the above example the "Test_Amendment_One" is the value I would like to
pass in a varaible:

$tempVar = "Test_Amendment_One"

rBvalue = document.voteForm.($tempVar)[0].checked

Obviously that doesn't work...what syntax should I use to correctly make
this work?

Thanks,
Ron

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux