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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello I have two questions and w

Status
Not open for further replies.

Huitzilopochtli

Programmer
Feb 18, 2002
81
DE
Hello

I have two questions and would appreciate some advice.

I have the following code which asks a user to go back and complete the form again. The code, which works, is:

<%
error = request.querystring(&quot;error&quot;)
select case cstr(error)

case &quot;1&quot;
Response.Write &quot;<p align=center><font face=verdana color=#B22222 size=1><b>You have not completed the topic, name or message fields<br> The server cannot begin processing unless these field(s) are complete</b></font>&quot;

case &quot;2&quot;
Response.Write &quot;<p align=center><font face=verdana color=#B22222 size=1><b>Sorry, Scripting is not allow on this MessageBoard<br> Please fix your Message</b></font>&quot;

case &quot;3&quot;
Response.Write &quot;<p align=center><font face=verdana color=#B22222 size=1><b>Sorry, you have entered an invalid email address<br> Please enter a valid email address</b></font>&quot;

case &quot;4&quot;
Response.Write &quot;<p align=center><font face=verdana color=#B22222 size=1><b>Sorry, you have entered an invalid URL<br> Please enter a valid URL</b></font>&quot;
case Else
Response.Write &quot;&quot;
end select
%>

The typical message, for instance, &quot;Sorry, you have entered an invalid URL<br> Please enter a valid URL&quot; appears in red (that's the =#B22222 colour).

If possible, though, I would like it to appear against a white background in a bordered table. How do I fit that HTML around the Response.Write statements? In other words, where are they positioned?

Finally, is there a tutorial somewhere explaining how ASP and HTML fits together?

Many thanks

Huitzilopochtli
 
In your html where you want it to appear put:



<%=StrEmailErrMsg%>


And as far as your case at the top of the page just do this on each one then write the error out wherever you want on your page:

case &quot;3&quot;

strEmailErrMsg = &quot;<p align=center><font face=verdana color=#B22222 size=1><b>Sorry, you have entered an invalid email address<br> Please enter a valid email address</b></font>&quot;
www.vzio.com
ASP WEB DEVELOPMENT



 
Hello snowboardr

Thank you for your post.

I think the error messages which are generated work. I have deliberately typed in false e.mail addresses and the message, inviting the user to retype the e.mail address does appear - and in red type.

But what I was asking was how I might have the red type appear within a border and against a white background - the error message would stand out more that way (because the whole bg colour is a dark blue and so the red type doesn't appear too clearly on it).

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top