CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 get database entry using javascript in ASP

Print topic Send  topic

Author Message
bon733

Posts: 25
Posted: 09/01/2005, 9:03 PM

I am trying to get the value of two fields in a table stored in a database to use in a javascript. How can i access these fields in a clean and easy way? I tried putting the fields on the form as hidden and then referencing them using the document.forms[0].... but I keep getting an error stating that the object is null or not an object. ANy ideas?
View profile  Send private message
DonB
Posted: 09/02/2005, 8:22 AM

Add id="field1" and id="field2" to the form fields (oh, by the way, these
can't be Labels, which do not exist as form fields merely as html text).

In the javascript reference them this way to get their values:

document.getElementById('field1').value
document.getElementById('field2').value

--
DonB

http://www.gotodon.com/ccbth


"bon733" <bon733@forum.codecharge> wrote in message
news:64317cf13ba175@news.codecharge.com...
> I am trying to get the value of two fields in a table stored in a database
to
> use in a javascript. How can i access these fields in a clean and easy
way? I
> tried putting the fields on the form as hidden and then referencing them
using
> the document.forms[0].... but I keep getting an error stating that the
object
> is null or not an object. ANy ideas?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

bon733

Posts: 25
Posted: 09/02/2005, 9:06 AM

Thank you very much. The code worked perfectly.
View profile  Send private message
DonB
Posted: 09/02/2005, 1:31 PM

I have found it to be much easier/reliable to locate things by ID.

--
DonB

http://www.gotodon.com/ccbth


"bon733" <bon733@forum.codecharge> wrote in message
news:64318786b81e86@news.codecharge.com...
> Thank you very much. The code worked perfectly.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.