Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2006, 08:13 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic radio Button

Hi,

having a few problems trying to get this script working...any help would be appreciated. This is what i have done. Basically if the user has filled in a field on a db, they will be aloud click a radio otherwise "N/A" will appear.

<%
Dim strChkBox
Dim vChkBox
vChkBox=false
If recordset1.Fields("FreightQuote").Value <> "" or NOT isnull(recordset1.Fields("FreightQuote").Value) Then
vChkBox=true
End If
If vChkBox=false then
Response.write "N/A"
Else
strChkBox=<input type="checkbox" name="chkbox" id="chkbox" value="<%=Recordset1.Fields.Item("CartID").Value%> ">
End If
%>

<div><input type="checkbox" name="chkbox" id="chkbox" value="<%strChkBox%>"></div>

********


This is the error Im receiving

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
newpage.asp, line 349, column 9
strChkBox=<input type="checkbox" name="chkbox" id="chkbox" value="<%=Recordset1.Fields.Item("CartID").Value
--------^


 
Old November 30th, 2006, 09:42 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Quote:
quote:Originally posted by gregd




strChkBox=<input type="checkbox" name="chkbox" id="chkbox" value="<%=Recordset1.Fields.Item("CartID").Value%> ">

<div><input type="checkbox" name="chkbox" id="chkbox" value="<%strChkBox%>"></div>
Ok, are you using the variable strChkBox to assign a value or are you trying to use it to dynamically write out the text box?

In code you should do this to get rid of the syntax error:

strChkBox="<input type='checkbox' name='chkbox' id='chkbox' value='" & Recordset1.Fields.Item("CartID").Value &"'>"


-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
radio button anwarraja Javascript 3 September 18th, 2007 08:18 PM
Radio button Jolley_tolson Javascript 2 July 15th, 2007 05:50 AM
Radio Button hoailing22 ASP.NET 1.0 and 1.1 Basics 1 June 2nd, 2005 12:08 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM
radio button damnnono_86 Access 5 October 28th, 2003 02:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.