hi guys
i have the following situation:
file test.asp contains a table where user writes his details.
once the table of a page is displayed, when user presses the proceed button, there is some code for checks and verification
i.e
<% if len(name)<3 then error="<br><brSender's Name/Number not valid!" %>
i have included the whole table inside div "content" and is displayed correctly. but, when some of the criteria (i.e length of name as above) is less than 3, then the error message is displayed outise the DIV "content". I tried to include all these checks inside the div "content" but when you visit the page for the first time, this results in a huge "content" page, as it includes all these if statements.
please advice on how to solve this issuei don't know asp yet, but try correcting your syntax...
"<br>Sender's Name/Number not valid!" instead of "<brSeners"...
did that work?the syntax was a copy-paste error. please ignore thatthis is part of the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"images/websms.css" />
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"images/style1.css" />
<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"../ie5.js"></script>
<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"images/DropDownMenu.js"></script>
<link rel="stylesheet" href=http://www.webdeveloper.com/forum/archive/index.php/"images/websms_layout.css" type="text/css">
</head>
<body>
<div id="breadCrumb">
<font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF">
Compose SMS</font>
</div><%
error=""
if len(name)<3 then error="<br><br> Senders Name/Number not valid!<br><br>"
if mobile="" and group="" then error=error & "<br><br> There are no receipients!<br><br>"
if message="" then error=error & "<br><br> Message Cannot be Blank!<br><br>"
%>
<div id="content">
<div class="feature">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD width="100%" height="37">
etc etc etc
</div>
</div>
</body>
</html>
if i use it like so, the table is shown in the correct position, the whole DIV content is placed at the correct position, but if one of the criteria is met, then the error message is displayed outside the content section, thus pushing everything downwards.
if i include the criteria cases inside the div content, then the page is totally messed up. Content DIV covers half page from top to bottom.
any advice guys???
thanks in advancei don't know this stuff, but think i can help you... where does your script actually print your error messages?
does the following code print outside of the #content?
<%
error=""
if len(name)<3 then error="<br><br> Senders Name/Number not valid!<br><br>"
if mobile="" and group="" then error=error & "<br><br> There are no receipients!<br><br>"
if message="" then error=error & "<br><br> Message Cannot be Blank!<br><br>"
%>
or do you call it in #content?if i dont include all this:
<%
error=""
if len(name)<3 then error="<br><br> Senders Name/Number not valid!<br><br>"
if mobile="" and group="" then error=error & "<br><br> There are no receipients!<br><br>"
if message="" then error=error & "<br><br> Message Cannot be Blank!<br><br>"
%>
in the #content, then this is displayed outside the DIV #content
if, however , i do include it, then the whole #content covers all the page of the IE or FF, i have red background and if i do include it, then 77% width of the page is all white (color of #content)The piece of code you posted doesn't include the code to write the variable "error" to the page. All you've shown is how you build the contents of the variable.
If the problem you're having is that when you include the error creation code it prints as text on the page, then the server isn't recognizing that you've embedded ASP code.
And since you're posting this question in the CSS section, you really should correct the error messages, i.e., drop the break tags and non-breaking spaces in favor of formatted paragraphs (one per error, top and bottom margins zero, left margin something like two em's). It will make it easier to read and easier to change.Prouton,
in this comment: If the problem you're having is that when you include the error creation code it prints as text on the page, then the server isn't recognizing that you've embedded ASP code.
reply: this is not the issue. if i include all checks, then the #content becomes HUGE. half the page is covered with #content. even the #header and #footer even before i put some values and press "Proceed" on my form (thus do the ckecks and if any errors, then display them)
please tell me what files you want me to send you to find a solution for this issue
thanks in advanceIs the page accessable from the internet? If so, just post the URL. If not, then I (and anyone else here who would like to help you) need to see the page in question, as well as any style sheets involved.ok, i have included all files i am using to access a page (in this example:"addtemplate.asp")oups...please change edit "drop.asp" and correct the paths...(remove images/)Okay...umm...wow...well, the first thing is that you need to clean up some code when it comes to your includes. You need to keep in mind that a webpage (when sent from the server to the requesting browser) consists of two distinct pieces: a header, and a body. It doesn't matter how many includes you use (in order to organize common pieces or to make the code easier to read), you can only have one pair of header tags, and one pair of body tags by the time you've gone from start to finish. What you've done is to put header and body tags in every file.
If you were to start with the unique page (in this case addtemplate.asp) having an opening html tag, opening header tag, then include the common heading info from a file (meta tags, style sheet calls, etc.), then javascript or ASP subroutine includes, then a header close tag, then a body open tag, then a page heading include, then menu includes, then the content for this particular page, then a footer include, then a body close tab and html close tag...then you'd have everything once.
Are your style sheets hand coded, or created by whatever program you use to create your webpages? The reason I ask is that they are unwieldy at best, and don't follow the principles of "cascading" that make style sheets so beneficial. For instance, if you were to start with declaring a font-family for paragraph and headings, then you would not need to repeat that value for each individual class descriptor unless the font-family were different than the default. Same thing with size and color. The idea is to define the attributes that are common first, and then embellish them as needed with classes. Also, defining attributes that are inheritable at a higher level (such as at the div) means that you don't have to keep setting the value at every level with it.
You also have a huge amount of none CSS markup in the html code, which is going to confuse matters when you try changing values in the stylesheet and nothing happens to the page. Also, anywhere you have an opening paragraph mark, you need a closing paragraph mark or the stylesheet attributes aren't going to be applied.
Anyways, try restructuring your includes/page structure and then let's give it another shot.
i have the following situation:
file test.asp contains a table where user writes his details.
once the table of a page is displayed, when user presses the proceed button, there is some code for checks and verification
i.e
<% if len(name)<3 then error="<br><brSender's Name/Number not valid!" %>
i have included the whole table inside div "content" and is displayed correctly. but, when some of the criteria (i.e length of name as above) is less than 3, then the error message is displayed outise the DIV "content". I tried to include all these checks inside the div "content" but when you visit the page for the first time, this results in a huge "content" page, as it includes all these if statements.
please advice on how to solve this issuei don't know asp yet, but try correcting your syntax...
"<br>Sender's Name/Number not valid!" instead of "<brSeners"...
did that work?the syntax was a copy-paste error. please ignore thatthis is part of the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"images/websms.css" />
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"images/style1.css" />
<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"../ie5.js"></script>
<script type="text/javascript" src=http://www.webdeveloper.com/forum/archive/index.php/"images/DropDownMenu.js"></script>
<link rel="stylesheet" href=http://www.webdeveloper.com/forum/archive/index.php/"images/websms_layout.css" type="text/css">
</head>
<body>
<div id="breadCrumb">
<font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF">
Compose SMS</font>
</div><%
error=""
if len(name)<3 then error="<br><br> Senders Name/Number not valid!<br><br>"
if mobile="" and group="" then error=error & "<br><br> There are no receipients!<br><br>"
if message="" then error=error & "<br><br> Message Cannot be Blank!<br><br>"
%>
<div id="content">
<div class="feature">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD width="100%" height="37">
etc etc etc
</div>
</div>
</body>
</html>
if i use it like so, the table is shown in the correct position, the whole DIV content is placed at the correct position, but if one of the criteria is met, then the error message is displayed outside the content section, thus pushing everything downwards.
if i include the criteria cases inside the div content, then the page is totally messed up. Content DIV covers half page from top to bottom.
any advice guys???
thanks in advancei don't know this stuff, but think i can help you... where does your script actually print your error messages?
does the following code print outside of the #content?
<%
error=""
if len(name)<3 then error="<br><br> Senders Name/Number not valid!<br><br>"
if mobile="" and group="" then error=error & "<br><br> There are no receipients!<br><br>"
if message="" then error=error & "<br><br> Message Cannot be Blank!<br><br>"
%>
or do you call it in #content?if i dont include all this:
<%
error=""
if len(name)<3 then error="<br><br> Senders Name/Number not valid!<br><br>"
if mobile="" and group="" then error=error & "<br><br> There are no receipients!<br><br>"
if message="" then error=error & "<br><br> Message Cannot be Blank!<br><br>"
%>
in the #content, then this is displayed outside the DIV #content
if, however , i do include it, then the whole #content covers all the page of the IE or FF, i have red background and if i do include it, then 77% width of the page is all white (color of #content)The piece of code you posted doesn't include the code to write the variable "error" to the page. All you've shown is how you build the contents of the variable.
If the problem you're having is that when you include the error creation code it prints as text on the page, then the server isn't recognizing that you've embedded ASP code.
And since you're posting this question in the CSS section, you really should correct the error messages, i.e., drop the break tags and non-breaking spaces in favor of formatted paragraphs (one per error, top and bottom margins zero, left margin something like two em's). It will make it easier to read and easier to change.Prouton,
in this comment: If the problem you're having is that when you include the error creation code it prints as text on the page, then the server isn't recognizing that you've embedded ASP code.
reply: this is not the issue. if i include all checks, then the #content becomes HUGE. half the page is covered with #content. even the #header and #footer even before i put some values and press "Proceed" on my form (thus do the ckecks and if any errors, then display them)
please tell me what files you want me to send you to find a solution for this issue
thanks in advanceIs the page accessable from the internet? If so, just post the URL. If not, then I (and anyone else here who would like to help you) need to see the page in question, as well as any style sheets involved.ok, i have included all files i am using to access a page (in this example:"addtemplate.asp")oups...please change edit "drop.asp" and correct the paths...(remove images/)Okay...umm...wow...well, the first thing is that you need to clean up some code when it comes to your includes. You need to keep in mind that a webpage (when sent from the server to the requesting browser) consists of two distinct pieces: a header, and a body. It doesn't matter how many includes you use (in order to organize common pieces or to make the code easier to read), you can only have one pair of header tags, and one pair of body tags by the time you've gone from start to finish. What you've done is to put header and body tags in every file.
If you were to start with the unique page (in this case addtemplate.asp) having an opening html tag, opening header tag, then include the common heading info from a file (meta tags, style sheet calls, etc.), then javascript or ASP subroutine includes, then a header close tag, then a body open tag, then a page heading include, then menu includes, then the content for this particular page, then a footer include, then a body close tab and html close tag...then you'd have everything once.
Are your style sheets hand coded, or created by whatever program you use to create your webpages? The reason I ask is that they are unwieldy at best, and don't follow the principles of "cascading" that make style sheets so beneficial. For instance, if you were to start with declaring a font-family for paragraph and headings, then you would not need to repeat that value for each individual class descriptor unless the font-family were different than the default. Same thing with size and color. The idea is to define the attributes that are common first, and then embellish them as needed with classes. Also, defining attributes that are inheritable at a higher level (such as at the div) means that you don't have to keep setting the value at every level with it.
You also have a huge amount of none CSS markup in the html code, which is going to confuse matters when you try changing values in the stylesheet and nothing happens to the page. Also, anywhere you have an opening paragraph mark, you need a closing paragraph mark or the stylesheet attributes aren't going to be applied.
Anyways, try restructuring your includes/page structure and then let's give it another shot.