Hi all,

    I got this sets(20) of defined constants which using them as keys to an
    define("FNAME", "fname");
    farray = array( FNAME => "hello" ,...);

    my question is how do I insert that directly into a javascript(to do
some client validation)
    I need this:
    var fname = document.addrform.fname.value

    var fname = document.addrform.{FName}.value        //don't work
    var fname = document.addrform.{'FName'}.value        //don't work
    var fname = document.addrform.[FName].value        //don't work

    I know this work, but messey
    $tmp = FNAME;
    var fname = document.addrform.{$tmp}.value

    I'am finding the use of define constants rather awkward. does anyone
make much use of them?


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

Reply via email to