473,473 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checkbox (dynamic Creation With Directives-classic Asp)

11 New Member
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 5535
Ashfaque Sayani
9 New Member
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
hifiger2004
11 New Member
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 Recognized Expert Specialist
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 Recognized Expert Specialist
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
hifiger2004
11 New Member
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
hifiger2004
11 New Member
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 Recognized Expert Top Contributor
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 Recognized Expert Top Contributor
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
hifiger2004
11 New Member
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 I try this (simplified example of what I have but...
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 dynamically and then I want to use it to get some results....
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 and code separate. Let's say I already have a...
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 programatically? An example page layout: Initially: ...
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 try and set up my array of pointers to Student...
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. Thanks, GJM
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" Style="z-index: 203; left: 538px; position:...
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 Access and now I want to add new column with checkbox...
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 e) { if (!Page.IsPostBack) {...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
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.