471,305 Members | 1,148 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,305 software developers and data experts.

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.

May 3 '06 #1
2 3463
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/
May 3 '06 #2
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.
May 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Alistair Saldanha | last post: by
24 posts views Thread by Jeremy J Starcher | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.