[Javascript] Reset the value of a SET of fields

Nick Fitzsimons nick at nickfitz.co.uk
Thu May 20 04:54:34 CDT 2004


On 20/5/04 1:23 am, "Marcos Oliva" <maor71 at hotmail.com> wrote:

> You should use the EVAL on javascript
> such as
> 
> var tempObj;
> tempObj=EVAL("document.form_name.first_name_" + num );
> 

You should avoid eval at all costs - it's a terribly inefficient way of
doing things. The same effect can be achieved using:

var tempObj = document.form_name["first_name_" + num];

HTH,

Nick Fitzsimons.
-- 
Nick Fitzsimons
nick at nickfitz.co.uk




More information about the Javascript mailing list