View Full Version : is there a javascript equivalent to $$var_name in PHP?

06-25-2004, 06:11 AM
Hello everyone--

I have been trying to solve a validation problem and I think the only way that i will be able to get it to work is to use the $$var_name [in PHP].

I have to put some variables together to form the name of the form field names. So the name of an input would be: description_VAR1 and I need to be able to reference the form element named "description_VAR1" to do some string validations. I hope that makes some sense.

Anyone have any ideas?

06-25-2004, 07:01 AM
Do you mean this?

var var1 = "blah";

I've been posting this link (http://www.litotes.demon.co.uk/js_info/sq_brackets.html) about "bracket notation" several times in this forum.
I'll probably put it in my sig later.