[Javascript] Reset the value of a SET of fields

Marcos Oliva maor71 at hotmail.com
Wed May 19 19:23:47 CDT 2004


David,

You should use the EVAL on javascript
such as

var tempObj;
tempObj=EVAL("document.form_name.first_name_" + num );

then you can do

tempObj.value = "" ;


say Hi to Jenny Kellog from me ..


Marcos Alois Oliva
"355/113 --  PI or not PI ? "
In the beginning, there was nothing, and God said, "Let there be light!"
And there was still nothing, but now you could see it. -
"The beginning of knowledge is the discovery of something we do not
understand."
- Frank Herbert (1920-1986)
"The essence of knowledge is, having it, to apply it; not having it,
to confess your ignorance."
- Confucius (551-479 BC)




>From: David Yee <david at amsresponse.com>
>Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>To: "'javascript at LaTech.edu'" <javascript at LaTech.edu>
>Subject: [Javascript] Reset the value of a SET of fields
>Date: Wed, 19 May 2004 17:00:58 -0700
>
>Hi all.  How can I write a function that will reset the value of a SET of
>fields (in this case, first_name_2, last_name_2, and email_2 would
>constitute one set) to blank? Basically this function will linked by a
>button next to each set of fields.
>
><form name=my_form method=POST>
><input type=first_name_1 size=10>
><input type=last_name_1 size=20>
><input type=email_1 size=30>
>
><input type=first_name_2 size=10>
><input type=last_name_2 size=20>
><input type=email_2 size=30>
>
><input type=first_name_2 size=10>
><input type=last_name_2 size=20>
><input type=email_2 size=30>
></form>
>
>
>I tried something like:
>
><script language=javascript>
>function clear_row(form_name, num)
>{
>	document.form_name.first_name + num = '';
>	document.form_name.last_name + num = '';
>	document.form_name.email + num = '';
>}
></script>
>
>
>One button would be like:
>
><input type=button onclick="clear_row(myform, 2)">
>
>But obviously the syntax is wrong in the function.  Thanks for any help.
>
>David
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
Express yourself with the new version of MSN Messenger! Download today - 
it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Javascript mailing list