By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.