472,326 Members | 2,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,326 software developers and data experts.

Checkbox (dynamic Creation With Directives-classic Asp)

Hi Guys,

I have encountered this probleme when I am having a Classic ASP code that was put inside a string variable including the directives (<% %>)

Page Error:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/signup/checkbox4.asp, line 6

&"<%= varTemp
-------------^

Below is the my Test Classic ASP, before moving to my actual ASP Coding. I hope this can be solved. Thanks in advance


<%
Dim sCheckBox
sCheckBox = sCheckBox + "<tr>" _
&"<td valign='middle'><input id='Checkbox' type='checkbox' name='Checkbox' " _
&"<%= varTemp %>/></td>" _
&"<td class='smallText'>Test Checkbox</td>" _
&"</tr>"
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<form name="frmMain" action="checkbox1.asp" method=post>
<tr><%= sCheckBox %></tr>
</form>
<P>&nbsp;</P>
</BODY>
</HTML
Apr 6 '07 #1
9 5397
Check the syntax of your script, particularly for closing statements, speech marks or brackets. Look for clues, count all the lines including blank lines

Also why is there extra backslash in the below line.
<%=varTemp %>/>

Normally this error is due to some small syntax error.

Hi Guys,

I have encountered this probleme when I am having a Classic ASP code that was put inside a string variable including the directives (<% %>)

Page Error:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/signup/checkbox4.asp, line 6

&"<%= varTemp
-------------^

Below is the my Test Classic ASP, before moving to my actual ASP Coding. I hope this can be solved. Thanks in advance


<%
Dim sCheckBox
sCheckBox = sCheckBox + "<tr>" _
&"<td valign='middle'><input id='Checkbox' type='checkbox' name='Checkbox' " _
&"<%= varTemp %>/></td>" _
&"<td class='smallText'>Test Checkbox</td>" _
&"</tr>"
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<form name="frmMain" action="checkbox1.asp" method=post>
<tr><%= sCheckBox %></tr>
</form>
<P>&nbsp;</P>
</BODY>
</HTML
Apr 9 '07 #2
Hi Ash, thanks for the reply :)

Honestly, I already tried another way by removing the "/" back slash, but the problem is still the same. The tag <input></input> is the same with <input... />

Actually, this is only my test program before transferring the concept to my real classic asp program with tables thru mssql2005 database.

There's a CustomerCategory Table that has a CustomerID and CategoryID. And the value of CategoryID will be used for the dynamic creation of checkboxes.

Let's say for example, for all 10 categories, only 3 of these are being stored in CustomerCategory Table. The question is how can I be able to populate the 3 categories by displaying thru 3 checked checkboxes?

Do you have any idea on doing this, dynamically?

Thanks in advance


---------------------------------
Check the syntax of your script, particularly for closing statements, speech marks or brackets. Look for clues, count all the lines including blank lines

Also why is there extra backslash in the below line.
<%=varTemp %>/>

Normally this error is due to some small syntax error.
Apr 9 '07 #3
jhardman
3,406 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1.  &"<%= varTemp %>/></td>" _
should be:
Expand|Select|Wrap|Line Numbers
  1. & <%=varTemp %> & "/></td>" _
Jared
Apr 10 '07 #4
jhardman
3,406 Expert 2GB
Let's say for example, for all 10 categories, only 3 of these are being stored in CustomerCategory Table. The question is how can I be able to populate the 3 categories by displaying thru 3 checked checkboxes?
I'm not sure I follow. Are you saying you will list a table with a dozen options each of which records can be selected via checkbox. Then when you submit the form some action is taken on those records selected? It sppears that you have found an answer to this question in one of your later posts. Are you still looking for a solution?

Jared
Apr 10 '07 #5
Hi Jhard

Honestly, I haven't found a solution yet regarding the "<%= ..%>. I just made a another way, a longer way just for me to continue the program. In my recent question is that, how can I check it out if the checkboxes are being checked or not. What I did was when I tried this code "If Request(CStr(Categorytbl("CategoryID")) <> "" then ... process.... it won't get into this condition. I just wanted to get the value of the checked checkboxes, that's all.

Anyway, I will try it again the one you've suggested about code block <%..%> .

Thank you Jhard


I'm not sure I follow. Are you saying you will list a table with a dozen options each of which records can be selected via checkbox. Then when you submit the form some action is taken on those records selected? It sppears that you have found an answer to this question in one of your later posts. Are you still looking for a solution?

Jared
Apr 10 '07 #6
I just tried the one you suggested but still it won't work.

Error:
Microsoft VBScript compilation error '800a03ea'

Syntax error

/signup/vendorcategories.asp, line 33

& <%=varTemp
--^


anyway, I have another work around.

Thanks Jhard... I am trying to figure it out if how can get the value of the checked checkboxes

Thanks



Hi Jhard

Honestly, I haven't found a solution yet regarding the "<%= ..%>. I just made a another way, a longer way just for me to continue the program. In my recent question is that, how can I check it out if the checkboxes are being checked or not. What I did was when I tried this code "If Request(CStr(Categorytbl("CategoryID")) <> "" then ... process.... it won't get into this condition. I just wanted to get the value of the checked checkboxes, that's all.

Anyway, I will try it again the one you've suggested about code block <%..%> .

Thank you Jhard
Apr 10 '07 #7
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. sCheckBox = sCheckBox & "<tr><td valign='middle'><input id='Checkbox' type='checkbox' name='Checkbox' " & varTemp & " /></td><td class='smallText'>Test Checkbox</td></tr>"
  2.  
this should work



i try and stay away from line continuation its sloppy.
Apr 10 '07 #8
iam_clint
1,208 Expert 1GB
you can get the checked value of the checkbox through javascript or ASP

Please explain to me in more detail what your trying todo.
Apr 10 '07 #9
Hi Clint,

Yes, finally it works. But I don't know yet if this will work as what's in my mind now. :)

Actually, what I am trying to do is to populate a checkboxes based from the data of my Category table.

For example, if I have 10 Categories, then 10 checkboxes must be displayed for the customer to check. And from my CustomerCategory table the fields there are only CustomerID and CategoryID. I will goin to use the value of CategoryID that will serve as the name of the checkboxes, for me to easily locate the checkbox. And the content of the variable varTemp is either "Checked" or ""(Unchecked).

But I already changed the concept yesterday on how to populate the checkboxes, and on how to detect if it is being checked or not.

Anyway, the solution you gave me is really a big help, and it can be used someday with my other upcoming program.

Thank you for parting your knowledge with me Clint.

Since it was solved already my problem in Classis ASP, by next week I will be moving to ASP.Net 2.0 and AJAX. And I am pretty sure, I have plenty of questions here in www.thescripts.com. I am hoping that you'll continue answering concerns from us.

Thank you Client :)



you can get the checked value of the checkbox through javascript or ASP

Please explain to me in more detail what your trying todo.
Apr 11 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Arne de Booij | last post by:
Hi all, I am trying to generate ASP code on the fly as I want to be able to control the code from the database and am running a problem. When...
2
by: JC | last post by:
Hello, I'm looking for examples of how to make dynamic creation of code and dynamic execution of the same code. I want to do some code...
3
by: Colin | last post by:
Hello, I can manage quite well in ASP but would like some advice in the best way to achieve dynamic layout in ASP.NET and still keep the page...
0
by: JohnS | last post by:
Hi! This may well have been asked before, but how do you best catch events from dynamic controls in ASP.NET i.e. those created and placed...
1
by: dav3 | last post by:
Any help here is appreciated folks. First in my Person class the comments = errors visual basics is giving me and I am not sure why. Also when i...
2
by: jmgopi | last post by:
Hi: Can somebody provide me samples on how to create a dynamic CollapsiblePanel using ASP.NET AJAX Toolkit. Any points are highly appreciated. ...
2
by: lightgram | last post by:
Hi I need to reset the position of a checkbox in my ASP.NET page. The checkbox is defined: <asp:CheckBox TextAlign=left ID="CheckBox2"...
1
by: dhamo | last post by:
How to bind checkbox with gridview in asp.net 2.0 I take a gridview control and bind data dynamicaly using code.I taken backend tool as a Ms...
0
by: tina2626 | last post by:
I m using this code in C#.net, for dynamic creation of GridView without using DB. <CODE> protected void Page_Load(object sender, EventArgs...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.