html - Checkbox within ColdFusion code -
i'm trying display data database , add checkbox @ end of each row. i've tried html tags , cf tags last few hours i'm getting errors.. great i'm totally new coldfusion. heres code :
<cfset = "bgcolor =###iif(myquery.currentrow mod 2, de('e6e6e6'),de('c0c0c0'))#" /> <cfscript> (i=1;i lte myquery.recordcount; i=i+1) writeoutput ("<tr " & & "><td>" & & "</td>" & "<td>" & myquery.userid[i] & "</td>" & "<td>" & myquery.fname[i] & "</td>" & "<td>" & myquery.sname[i] & "</td>"& "<td>" & myquery.phone[i] & "</td>"& "<td>" & myquery.datejoined[i] & " </td>"& "<td>" & myquery.address[i] & "</td>"& "<td>" & <cfinput type="checkbox" name="post_home"> & " </td></tr>"); </cfscript>
last line (line 55) causing error.. in advance
invalid cfml construct found on line 55 @ column 37.
coldfusion looking @ following text: checkbox
cfml compiler processing: expression beginning writeoutput, on line 48, column 1.this message caused problem in expressions structure. script statement beginning writeoutput on line 48, column 1. script statement beginning on line 45, column 9. cfscript tag beginning on line 44, column 2. cfscript tag beginning on line 44, column 2. cfscript tag beginning on line 44, column 2. error occurred in c:/inetpub/wwwroot/sem2/ashowusers.cfm: line 55 53 : "<td>" & myquery.datejoined[i] & " </td>"& 54 : "<td>" & myquery.address[i] & "</td>"& 55 : "<td><input type="checkbox" name="post_home"></td></tr>"); 56 : 57 : resources: check coldfusion documentation verify using correct syntax. search knowledge base find solution problem. browser mozilla/5.0 (windows nt 6.1) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.64 safari/537.31 remote address ::1 referrer http://localhost/sem2/adminmainpage.cfm date/time 13-may-13 10:08 pm stack trace coldfusion.compiler.parseexception: invalid cfml construct found on line 55 @ column 37. @ coldfusion.compiler.cfml40.generateparseexception(cfml40.java:13130) @ coldfusion.compiler.cfml40.jj_consume_token(cfml40.java:13001) @ coldfusion.compiler.cfml40.functionparameters(cfml40.java:6523) @ coldfusion.compiler.cfml40.complexreference(cfml40.java:6381) @ coldfusion.compiler.cfml40.variablereference(cfml40.java:6300) @ coldfusion.compiler.cfml40.primaryexpression(cfml40.java:6105) @ coldfusion.compiler.cfml40.unaryexpression(cfml40.java:5955) @ coldfusion.compiler.cfml40.exponentialexpression(cfml40.java:5912) @ coldfusion.compiler.cfml40.multiplydivisionexpression(cfml40.java:5865) @ coldfusion.compiler.cfml40.integerdivisionexpression(cfml40.java:5846) @ coldfusion.compiler.cfml40.modexpression(cfml40.java:5827) @ coldfusion.compiler.cfml40.additionexpression(cfml40.java:5780) @ coldfusion.compiler.cfml40.concatexpression(cfml40.java:5761) @ coldfusion.compiler.cfml40.comparisonexpression(cfml40.java:5614) @ coldfusion.compiler.cfml40.notexpression(cfml40.java:5564) @ coldfusion.compiler.cfml40.andexpression(cfml40.java:5536) @ coldfusion.compiler.cfml40.orexpression(cfml40.java:5517) @ coldfusion.compiler.cfml40.xorexpression(cfml40.java:5498) @ coldfusion.compiler.cfml40.eqvexpression(cfml40.java:5479) @ coldfusion.compiler.cfml40.impexpression(cfml40.java:5460) @ coldfusion.compiler.cfml40.hookexpression(cfml40.java:5415) @ coldfusion.compiler.cfml40.expr(cfml40.java:5399) @ coldfusion.compiler.cfml40.cfscriptexpression(cfml40.java:2576) @ coldfusion.compiler.cfml40.simplestatement(cfml40.java:643) @ coldfusion.compiler.cfml40.cfscriptstatement(cfml40.java:1595) @ coldfusion.compiler.cfml40.complexstatement(cfml40.java:1710) @ coldfusion.compiler.cfml40.cfscriptstatement(cfml40.java:1530) @ coldfusion.compiler.cfml40.cfscript(cfml40.java:1455) @ coldfusion.compiler.cfml40.cfml(cfml40.java:4568) @ coldfusion.compiler.cfml40.cfelse(cfml40.java:442) @ coldfusion.compiler.cfml40.cfif(cfml40.java:316) @ coldfusion.compiler.cfml40.cfml(cfml40.java:4554) @ coldfusion.compiler.cfml40.cfelse(cfml40.java:442) @ coldfusion.compiler.cfml40.cfif(cfml40.java:316) @ coldfusion.compiler.cfml40.cfml(cfml40.java:4554) @ coldfusion.compiler.cfml40.start(cfml40.java:4994) @ coldfusion.compiler.neotranslator.parsepage(neotranslator.java:694) @ coldfusion.compiler.neotranslator.parsepage(neotranslator.java:675) @ coldfusion.compiler.neotranslator.parseandtransform(neotranslator.java:428) @ coldfusion.compiler.neotranslator.translatejava(neotranslator.java:370) @ coldfusion.compiler.neotranslator.translatejava(neotranslator.java:147) @ coldfusion.runtime.templateclassloader$templatecache$1.fetch(templateclassloader.java:436) @ coldfusion.util.lrucache.get(lrucache.java:180) @ coldfusion.runtime.templateclassloader$templatecache.fetchserial(templateclassloader.java:362) @ coldfusion.util.abstractcache.fetch(abstractcache.java:58) @ coldfusion.util.softcache.get_statsoff(softcache.java:133) @ coldfusion.util.softcache.get(softcache.java:81) @ coldfusion.runtime.templateclassloader.findclass(templateclassloader.java:609) @ coldfusion.filter.pathfilter.invoke(pathfilter.java:101) @ coldfusion.filter.licensefilter.invoke(licensefilter.java:30) @ coldfusion.filter.exceptionfilter.invoke(exceptionfilter.java:94) @ coldfusion.filter.clientscopepersistencefilter.invoke(clientscopepersistencefilter.java:28) @ coldfusion.filter.browserfilter.invoke(browserfilter.java:38) @ coldfusion.filter.nocachefilter.invoke(nocachefilter.java:46) @ coldfusion.filter.globalsfilter.invoke(globalsfilter.java:38) @ coldfusion.filter.datasourcefilter.invoke(datasourcefilter.java:22) @ coldfusion.filter.cachingfilter.invoke(cachingfilter.java:62) @ coldfusion.cfmservlet.service(cfmservlet.java:204) @ coldfusion.bootstrap.bootstrapservlet.service(bootstrapservlet.java:89) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ coldfusion.monitor.event.monitoringservletfilter.dofilter(monitoringservletfilter.java:42) @ coldfusion.bootstrap.bootstrapfilter.dofilter(bootstrapfilter.java:46) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:224) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:169) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:472) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:168) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:98) @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:928) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:414) @ org.apache.coyote.ajp.ajpprocessor.process(ajpprocessor.java:203) @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:539) @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:298) @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:886) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:908) @ java.lang.thread.run(thread.java:662)
you're missing quotes around <cfinput>
tag. need use single quote here concatenate properly.
<cfscript> ( i=1; <= myquery.recordcount; i++ ) { writeoutput ("<tr " & & "><td>" & & "</td>" & "<td>" & myquery.userid[i] & "</td>" & "<td>" & myquery.fname[i] & "</td>" & "<td>" & myquery.sname[i] & "</td>" & "<td>" & myquery.phone[i] & "</td>" & "<td>" & myquery.datejoined[i] & "</td>" & "<td>" & myquery.address[i] & "</td>" & "<td>" & '<input type="checkbox" name="post_home">' & "</td></tr>"); } </cfscript>
alternatively put last line in single quotes.
'<td><input type="checkbox" name="post_home"></td></tr>');
Comments
Post a Comment