Assining value to "do" variable

  • Thread starter niraj.kumar.ait
  • Start date
N

niraj.kumar.ait

Hi,

I have a variable "do" declared in the html form . When I go to assign
do some value like below it gives error(since do is a keyword) .Is
there any way to assign the value to "do" variable.

document.myForm.do.value= 'add';


TIA
Niraj
 
R

Randy Webb

(e-mail address removed) said the following on 5/3/2006 12:41 AM:
Hi,

I have a variable "do" declared in the html form . When I go to assign
do some value like below it gives error(since do is a keyword) .Is
there any way to assign the value to "do" variable.

document.myForm.do.value= 'add';

document.myForm.elements['do'].value="add";

<URL: http://www.JavascriptToolbox.com/bestpractices/>
Item #1
 
R

RobG

Randy Webb said on 03/05/2006 3:45 PM AEST:
(e-mail address removed) said the following on 5/3/2006 12:41 AM:
Hi,

I have a variable "do" declared in the html form . When I go to assign
do some value like below it gives error(since do is a keyword) .Is
there any way to assign the value to "do" variable.

document.myForm.do.value= 'add';


document.myForm.elements['do'].value="add";

<URL: http://www.JavascriptToolbox.com/bestpractices/>
Item #1

Or:

<URL:http://www.jibbering.com/faq/#FAQ4_39>

:)
 
R

Randy Webb

RobG said the following on 5/3/2006 2:39 AM:
Randy Webb said on 03/05/2006 3:45 PM AEST:
(e-mail address removed) said the following on 5/3/2006 12:41 AM:
Hi,

I have a variable "do" declared in the html form . When I go to assign
do some value like below it gives error(since do is a keyword) .Is
there any way to assign the value to "do" variable.

document.myForm.do.value= 'add';


document.myForm.elements['do'].value="add";

<URL: http://www.JavascriptToolbox.com/bestpractices/>
Item #1

Or:

<URL:http://www.jibbering.com/faq/#FAQ4_39>

I knew it was in there somewhere but was too lazy to hunt it down again
for the 785 millionth time and I had the bestpractices URL readily
available so I went with it :)

I think they should print those two documents out and beat people in the
head with them when they first post to Usenet.......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top