Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2006
    Posts
    6

    Unanswered: Font format issue. (Classic ASP)

    I returning information from a database that check the database for item that are below a certain level (it's a stock inventory), and then returns the result of that. The function itself works fine, however the text is unformatted and i wish to be able to format the text. As a bit of a newbie when it comes to ASP (my friend did the code for me) I was wondering if anyone could help. The code is as follows:

    Dim sQuery
    sQuery = "select ItemName from item where CurrentQty < ParLevel"
    oRS.Open sQuery, oConnection

    do while not oRS.EOF
    Response.Write("<div align=""center"">" & oRS("ItemName") & " is below par level</font><div>")
    oRS.MoveNext
    loop

    oRS.Close
    Set oRS = Nothing
    %>


    Thanks in advance.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    How do you want the text formatted?
    Also, I notice </font>, with no opening tag... That can't be right!

    How are you at creating tables? That's always an option!

    I will just quickly slip in that the <font> tag has been deprecated from XHTML (but that's a topic for another day!)
    George
    Home | Blog

  3. #3
    Join Date
    Oct 2006
    Posts
    6
    I have just noticed that. That's not suppose to be there, that was when I was trying to format it myself. I only want basic formatting, the text to be a bit bolder and bigger. At the moment, it's just at a default value. Here's the code without the </font> tag

    Dim sQuery
    sQuery = "select ItemName from item where CurrentQty < ParLevel"
    oRS.Open sQuery, oConnection

    do while not oRS.EOF
    Response.Write("<div align=""center"">" & oRS("ItemName") & " is below par level<div>")
    oRS.MoveNext
    loop

    oRS.Close
    Set oRS = Nothing
    %>


    Thanks,

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Ok, a couple of things I would change for starters is the use of double-double quotes.
    Response.Write("<div align=""center"">" & ...
    Should become:
    Response.Write("<div align='center'>" & ...

    IF you simply want slightly bigger bolder text, then the header tags <h1></h1>, <h2></h2> should do what you want. The best resource for HTML (imo) is www.w3schools.com

    Oh, and to tidy up your code, so that you're not repeating the same div's/styles/fonts for every record in your recordset, put the styles outside fo the loop
    Code:
    Response.Write("<div align='center'><h1>")
    do while not oRS.EOF
    Response.Write(oRS("ItemName") & " is below par level")
    oRS.MoveNext
    loop
    Response.Write("</h1></div>")
    Please ask if you don't understand anything I've written!
    George
    Home | Blog

  5. #5
    Join Date
    Oct 2006
    Posts
    6
    Thanks! You've been a great help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •