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

If then statement embedded in html

Status
Not open for further replies.

axsom1

Technical User
Feb 27, 2001
67
US
I keep getting the "expected end of statement" error with the following code.

strHTML = strHTML & &quot; <TD><P class=&quot;&quot;small2&quot;&quot;><FONT color=&quot;&quot;red&quot;&quot;><B>*</b></font>Are you younger than 18 years of age?<BR><input type=&quot;&quot;Radio&quot;&quot; name=&quot;&quot;Gen_EighteenOrYounger&quot;&quot; value=&quot;&quot;Yes&quot;&quot; align=&quot;&quot;LEFT&quot;&quot; readonly=&quot;&quot;true&quot; IF request.form.item(&quot;Gen_EighteenOrYounger&quot;)=&quot;Yes&quot; THEN &quot;Checked&quot; END IF &quot;>Yes <input type=&quot;&quot;Radio&quot;&quot; name=&quot;&quot;Gen_EighteenOrYounger&quot;&quot; value=&quot;&quot;No&quot;&quot; align=&quot;&quot;LEFT&quot;&quot; readonly=&quot;&quot;true&quot; IF request.form.item(&quot;Gen_EighteenOrYounger&quot;)=&quot;No&quot; THEN &quot;Checked&quot; END IF &quot;>No</TD>&quot;

It tells me it is at column 225 of this line, I just don't understand why. Hoping someone with some fresh eyes can point out what I am missing.

Thanks!
John Axsom
 
Axsome1 I would suggest gettin Dreamweaver MX 2004 if you can, you would have caught your Mistake rigth away.

You did not have & seperating your if's

Although this way is a much better way to do what you are trying to do:

<%
Dim sFrmAge
Dim sYesCheck
Dim sNoCheck

sFrmAge = Request.form.item(&quot;Gen_EighteenOrYounger&quot;)

Select Case

Case &quot;No&quot;
sNoCheck = &quot; Checked&quot;
Case &quot;Yes&quot;
sYesCheck = &quot; Checked&quot;
Case Else
'Response.Redirect &quot;no_age.asp&quot;
'Response.Write &quot;No age specified&quot;
'Or take it out whatever..
End Select

strHTML = strHTML & &quot;<TD><P class=&quot;&quot;small2&quot;&quot;><FONT color=&quot;&quot;red&quot;&quot;><B>*</b></font>Are you younger than 18 years of age?<BR><input type=&quot;&quot;Radio&quot;&quot; name=&quot;&quot;Gen_EighteenOrYounger&quot;&quot; value=&quot;&quot;Yes&quot;&quot; align=&quot;&quot;LEFT&quot;&quot; readonly=&quot;&quot;true&quot; & sYesCheck & &quot;>Yes <input type=&quot;&quot;Radio&quot;&quot; name=&quot;&quot;Gen_EighteenOrYounger&quot;&quot; value=&quot;&quot;No&quot;&quot; align=&quot;&quot;LEFT&quot;&quot; readonly=&quot;&quot;true&quot; & sNoCheck & &quot;>No</TD>&quot;

%>

- Jason

www.vzio.com
ASP WEB DEVELOPMENT
 
oops made a mistake

should be
Code:
Select Case sFrmAge
[code]
at the top

                        [b]www.vzio.com[/b]
                    ASP WEB DEVELOPMENT
 
The READONLY attribute doesn't take any true/false values. It's just READONLY. Also...everywhere you have this attribute you have the TRUE value enclosed by 3 quotes not 4 like this: readonly=&quot;&quot;true&quot;

This will blow up your code.
 
Hey thanks for the help guys! I don't know why I just didn't do select statements to begin with...oh well...must of been a long week.

Everything works great now so again, appreciate all the help!

John Axsom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top