Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a value from a variable in the VB Script area

Status
Not open for further replies.

haneen97

Programmer
Dec 10, 2002
280
US
Hi,

document.getElementById('txtBalance').value = <%=Balance%>;

I thought I could use the above line to copy a currency value fromt he VBScript variables area to that field while executing the JScript function.

Any idea?

Thanks

Mo
 
You need to encapsulate the value in quotes:
Code:
document.getElementById('txtBalance').value = [COLOR=red][b]"[/b][/color]<%=Balance%>[COLOR=red][b]"[/b][/color];
unless the value is a number. I'm guessing since it's currency it contains commas (,) and/or dollar signs ($) in which case you'd need the quotes.

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
[banghead]
 
You're very welcome haneen97.

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top