Portal Team wrote:
>
> hi
>
> i need to refer to the value of a textbox called txtName in a form called
> myForm
>
> i can do this using document.myForm.txtName.value
>
> what i want to do is be able to pass the control name as a variable
>
> ctrlname="txtname";
>
> alert(document.myForm.ctrlname.value);
>
> what is the right syntax so that ctrlname is substituted by the value in
> it..

if I understand:

document.myForm.elements[ctrlname].value

--
 ____
||""||    Arnaud_Vandyck/STEFormations
||__||        Informatique/Internet
[ -=.]`)     Val_Benoit/ULg/Belgium
====== 0  Telephone:_32_(0)4/366.90.55

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to