Should parameter used in eval() be string?
<p>I am coding to make simple validator for form.</p>

<p>In order to validate form dynamically, I've planned to use eval function.</p>

<p>As you see in the javascript coding, <strong>var funcCall becomes a name of function with a parameter of jquery selected dom.</strong> </p>

<p>But that makes error. (Uncaught SyntaxError: Unexpected identifier)</p>

<p>What I'd like to know is that should I only use String in eval() or is there a better way to do this?</p>

<hr>

<pre><code>var Submit = {
    validateFilters : ["Submit.emptyCheckFilter"], // This is validator filters
    emptyCheckFilter : function(element) 
        //this is filter to validate if it's empty or not.
        console.log("this has been called");
    },
    doValidate : function(form) {
        var children = $(form).children();
        var filters = Submit.validateFilters;

        $.each(children, function(key, value) { // Loop over form element

            for(var i = 0; i &lt; filters.length; i++) {
                //Here's error comes the value is not String. it's selected item by jQuery.
                //Uncaught SyntaxError: Unexpected identifier &lt;= This occurs.
                var funcCall = filters[i] + "(" + value + ");";

                // Call the filter
                eval(funcCall);
            }

            return false; 
        });
    },
   ...
}
</code></pre>
