f



alert("document.all.txtbox"+".value")

Hi All,

// code start

 alert("document.all.txtbox"+valueA+".value")

// end code

could you please advice,
can it show the value of txtbox ?

Best regards,
Boki.

0
bokiteam (401)
5/3/2006 5:23:40 AM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

2 Replies
467 Views

Similar Articles

[PageSpeed] 41

Boki said the following on 5/3/2006 1:23 AM:
> Hi All,
> 
> // code start
> 
>  alert("document.all.txtbox"+valueA+".value")
> 
> // end code
> 
> could you please advice,
> can it show the value of txtbox ?

IE only code or cross-browser?

document.forms['formID'].elements['txtbox'+valueA].value;

-- 
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
0
Randy
5/3/2006 5:48:16 AM
Randy Webb wrote:
> Boki said the following on 5/3/2006 1:23 AM:
> 
>> Hi All,
>>
>> // code start
>>
>>  alert("document.all.txtbox"+valueA+".value")
>>
>> // end code
>>
>> could you please advice,
>> can it show the value of txtbox ?
> 
> IE only code or cross-browser?
> 
> document.forms['formID'].elements['txtbox'+valueA].value;

Aside from the fact that the OP's code wouldn't give the desired result 
anyways. Assume valueA = '1'. The alert would read, literally:

document.all.txtbox1.value

....not the value of the element. It's in quotes.
0
Tony
5/3/2006 5:32:26 PM
Reply: