473,804 Members | 3,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem validating HTML because of ASP code

I'm having problems validating my HTML code because of some
ASP code I'm using:

---Start Code---

<%
If rs("Average") = 0 Then
VotingImage = "<img src="/images/0.gif" alt='No votes yet'>"
ElseIf rs("Average") >= 1 And rs("Average") < 2 Then
VotingImage = "<img src=/images/1.gif alt='1 out of 6 stars'>"
End If
%>

<!-- Insert stars-->
<%=VotingImage% >

---End Code---

The problem is of course that the code inserted, and used in the
HTML code in the end result is : <img src=/images/1.gif alt='1 out of 6 stars'>
The attribute value /images/1.gif for the scr attribute isn't enclosed in single or
double quotation marks as it should be, and this results in the code not being
validated as proper HTML. :-/

I have tried enclosing it in quotation marks both this and that way, but it doesn't
work..... and it's driving me nuts. :-(

--
Torbjørn Pettersen
Editor/Webmaster
FantaFiction

www.fantafiction.com
Jul 20 '05 #1
12 2056


Torbjørn Pettersen wrote:
I'm having problems validating my HTML code because of some
ASP code I'm using:

---Start Code---

<%
If rs("Average") = 0 Then
VotingImage = "<img src="/images/0.gif" alt='No votes yet'>"
ElseIf rs("Average") >= 1 And rs("Average") < 2 Then
VotingImage = "<img src=/images/1.gif alt='1 out of 6 stars'>"


I think you want
VotingImage = "<img src=""/images/1.gif"" alt=""1 out of 6 starts"">"
at least that is the way to insert a double quote into a string literal
with VBScript.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2


Torbjørn Pettersen wrote:
I'm having problems validating my HTML code because of some
ASP code I'm using:

---Start Code---

<%
If rs("Average") = 0 Then
VotingImage = "<img src="/images/0.gif" alt='No votes yet'>"
ElseIf rs("Average") >= 1 And rs("Average") < 2 Then
VotingImage = "<img src=/images/1.gif alt='1 out of 6 stars'>"


I think you want
VotingImage = "<img src=""/images/1.gif"" alt=""1 out of 6 starts"">"
at least that is the way to insert a double quote into a string literal
with VBScript.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3
Torbjørn Pettersen wrote:
I'm having problems validating my HTML code because of some
ASP code I'm using:

<%
If rs("Average") = 0 Then
VotingImage = "<img src="/images/0.gif" alt='No votes yet'>"
ElseIf rs("Average") >= 1 And rs("Average") < 2 Then
VotingImage = "<img src=/images/1.gif alt='1 out of 6 stars'>"
End If
%>


ASP/VBScript

intAverage = rs.Fields.Item( "Average").Valu e
if (intAverage = 0) then
VotingImage = '<img src="/images/0.gif" alt="No votes yet">'
elseif (intAverage >= 1 and intAverage < 2) then
VotingImage = '<img src="/images/1.gif" alt="1 out of 6 stars">'
end if
--
Andrew Urquhart
- FAQ: www.htmlhelp.org/faq/html/
- Archive: www.tinyurl.com/2zw7m
- Contact: www.andrewu.co.uk/contact/
- Employ me: Front/middle tier ASP developer with WAI & web standards
Jul 20 '05 #4
Torbjørn Pettersen wrote:
I'm having problems validating my HTML code because of some
ASP code I'm using:

<%
If rs("Average") = 0 Then
VotingImage = "<img src="/images/0.gif" alt='No votes yet'>"
ElseIf rs("Average") >= 1 And rs("Average") < 2 Then
VotingImage = "<img src=/images/1.gif alt='1 out of 6 stars'>"
End If
%>


ASP/VBScript

intAverage = rs.Fields.Item( "Average").Valu e
if (intAverage = 0) then
VotingImage = '<img src="/images/0.gif" alt="No votes yet">'
elseif (intAverage >= 1 and intAverage < 2) then
VotingImage = '<img src="/images/1.gif" alt="1 out of 6 stars">'
end if
--
Andrew Urquhart
- FAQ: www.htmlhelp.org/faq/html/
- Archive: www.tinyurl.com/2zw7m
- Contact: www.andrewu.co.uk/contact/
- Employ me: Front/middle tier ASP developer with WAI & web standards
Jul 20 '05 #5
Martin Honnen wrote...
I think you want
VotingImage = "<img src=""/images/1.gif"" alt=""1 out of 6 starts"">"
at least that is the way to insert a double quote into a string literal
with VBScript.


Yes, that's what I wanted. :-) Thanks! My page is getting closer and closer
to being validated, just another couple of hours with blood, sweat and foul
language, and it should be done. :-D

--
Torbjørn Pettersen
Editor/Webmaster
FantaFiction

www.fantafiction.com
Jul 20 '05 #6
Martin Honnen wrote...
I think you want
VotingImage = "<img src=""/images/1.gif"" alt=""1 out of 6 starts"">"
at least that is the way to insert a double quote into a string literal
with VBScript.


Yes, that's what I wanted. :-) Thanks! My page is getting closer and closer
to being validated, just another couple of hours with blood, sweat and foul
language, and it should be done. :-D

--
Torbjørn Pettersen
Editor/Webmaster
FantaFiction

www.fantafiction.com
Jul 20 '05 #7
On Tue, 13 Apr 2004 18:23:01 +0200, "Torbjørn Pettersen" <tpe AT
broadpark DOT no> wrote:
Martin Honnen wrote...
I think you want
VotingImage = "<img src=""/images/1.gif"" alt=""1 out of 6 starts"">"
at least that is the way to insert a double quote into a string literal
with VBScript.


Yes, that's what I wanted. :-) Thanks! My page is getting closer and closer
to being validated, just another couple of hours with blood, sweat and foul
language, and it should be done. :-D


The next page will be a lot easier. Honest. :-)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #8
On Tue, 13 Apr 2004 18:23:01 +0200, "Torbjørn Pettersen" <tpe AT
broadpark DOT no> wrote:
Martin Honnen wrote...
I think you want
VotingImage = "<img src=""/images/1.gif"" alt=""1 out of 6 starts"">"
at least that is the way to insert a double quote into a string literal
with VBScript.


Yes, that's what I wanted. :-) Thanks! My page is getting closer and closer
to being validated, just another couple of hours with blood, sweat and foul
language, and it should be done. :-D


The next page will be a lot easier. Honest. :-)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #9
Stephen Poley wrote...
Yes, that's what I wanted. :-) Thanks! My page is getting closer and closer
to being validated, just another couple of hours with blood, sweat and foul
language, and it should be done. :-D


The next page will be a lot easier. Honest. :-)


I more or less expected it to be Hell. A combination of FrontPage and different
hand coders.... And I don't really know anything about CSS, started using it
this week. And I'm new to DreamWeaver too. ;-)

Well, learning as I go has proven to work before, and this group seems to be a
real treasure. :-) Friendly people who don't yell at newbies like me asking stupid
questions.

--
Torbjørn Pettersen
Editor/Webmaster
FantaFiction

www.fantafiction.com
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
4788
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show that happening. But if you look at it in Firefox you can see the small gap of white where the semi-circle image is broken. I've tried changing the background colors to gray in cells and tables
1
1540
by: Pat Gibson | last post by:
Hello all, I am very new to web design but am learning as I go so here goes with my problem... I have a website on Ucoz (which I paid for) and the site looks ok but I am having problems locating the errors from the validation check. I have tried through their forums but they say they are not there to help with coding, ok. The list of errors I am receiving are all located in areas that apparently I have no access to. I will paste my code...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.