PDA

For continued disscussion on this topic : Confused? You will be..



WillyBanjo
08-18-2000, 02:45 PM
Hi chaps. Got a question. I'm setting up my accounts as an Access DB; basically consists of amount, description, and whether it's going in :) or going out :(
Very simple ASP pulls info out, and writes a table with it.

Now, I would dearly love any entries in the "Amount" field to appear in my table with black text when the "IN?" field was TRUE, and red text when it was FALSE (ie: money going out). I can do this in JavaScript, but have no idea in VBScript. So: can someone either (a) show me if (and how) I can pass info from VBScript to JavaScript, or (b) show me how to set text properties (and other fun stuff like bgcolor) in VBScript?

Is it just a case of making an if statement with several possible response.write's in it?

Oh - and while I'm here: assuming I'm not going to be swamped by thousands of eager surfers, how reliable is Access as a live DB?

[Edited by WillyBanjo on 08-18-2000 at 08:50 AM]

Vincent Puglia
08-19-2000, 12:25 AM
Hi Willy,

Have you tried:

<%
if IN response.write"<font color='black'> the text </font>"
else response.write"<font color='red'> the text </font>"
endif
%>

According to the ASP Developer's Guide, it should work.

Regarding javascript accessing an asp variable: I think this should work:

var javascriptVar = <% varName %>

Regarding Access: if you are getting under tens of thousands of hits per day, it should stand up.

Vinny

gzazJim
08-19-2000, 01:22 AM
Hey WB

Everything Vincent said is on the money! :D Thanks Vincent!

Jim

Arielladog
08-19-2000, 02:14 AM
Just curious, but how many languages do you guys no.

Only language I know is JavaScript, and a tad of PHP :(

Adog :cool:

Vincent Puglia
08-19-2000, 08:42 AM
Thanks Jim :)

Guess the 40 bucks or so for the book was well-spent after all (though I also think it was doing a pretty good job holding my door ajar :) But gawd, I hate subs.


aDog: "...do you guys no." :) anglais, mais un peu

Vinny

WillyBanjo
08-20-2000, 05:48 PM
Cheers very much! Didn't think of putting var in VB delimiter-thingies. (Trust me, I'm a pro.)

And adog - just javascript & slightly more asp than I did 5 minutes ago. Although I can also insult people in Welsh and Swahili.

WB

Vincent Puglia
08-20-2000, 06:54 PM
Hi Willy,

That's what makes this forum fun -- seeing -- and coming up -- with different solutions for the same problems.

though, now that I think of it... is this the proper syntax?
var javascriptVar = <% = varName %>
or without the second equal sign?
Vinny