HighDots Forums  

How to access a checkbox whose name is stored in a variable - Urgent please help

alt.html.dhtml alt.html.dhtml


Discuss How to access a checkbox whose name is stored in a variable - Urgent please help in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ranju
 
Posts: n/a

Default How to access a checkbox whose name is stored in a variable - Urgent please help - 08-05-2004 , 06:43 AM






Hi,

I have a situtation where the name of my checkbox is stored in a
variable. How do I access that checkbox

var strCheckName=""
.......
strCheckName = "chk1";
document.myform.chk1.value - I need to do this by using strCheckName
- something like document.myform.strCheckName.value.

Thanks and warm regards,
Ranju

Reply With Quote
  #2  
Old   
G Roydor
 
Posts: n/a

Default Re: How to access a checkbox whose name is stored in a variable -Urgent please help - 08-05-2004 , 07:15 AM








Ranju a écrit:
Quote:
Hi,

I have a situtation where the name of my checkbox is stored in a
variable. How do I access that checkbox

var strCheckName=""
......
strCheckName = "chk1";
document.myform.chk1.value - I need to do this by using strCheckName
document.myform.elements[strCheckName].value

Quote:
- something like document.myform.strCheckName.value.

Thanks and warm regards,
Ranju


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.