I think Amir is adding an html <script> tag to the template and not using a tapestry .script file.
The template parser doesn't handle inline javascript very well and I don't think it ever will. The solution would be to create .script file and place it in the classpath (at least in Tap 3 it has to be in the classpath). a minimal .script file... <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE script PUBLIC "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd"> <script> <body> <![CDATA[ function onInvestigationStateSubmit .... ]]> </body> </script> and then use a Script component to insert the .script file.. <span jwcid="@Script" script="/path/to/my/Script.script"> recall that the path is a path in the classpath. Geoff On 12/9/05, Richard Kirby <[EMAIL PROTECTED]> wrote: > Hi, > > The script file is an XML file. Therefore you need to escape any special > XML characters (ie & and <) with their entities, or better still, mark > the whole section as cdata. If you look carefully, you have a < in the > middle of your javascript, which any XML parser will assume marks the > start of a tag. > > Try: > > <script> > <![CDATA[ > function onInvestigationStateSubmit > .... > > ]]> > </script> > > Richard > > [EMAIL PROTECTED] wrote: > > >Hi, > > > >I need to check that at least one check box is checked in a form, since this > >was reusable I simply put it in the .html page. > > > >The script: > > > ><script> > >function onInvestigationStateSubmit(button) { > > > > var valid = false; > > > > var form = button.form; > > var select = form.stateSelect; > > var option = select.options[select.selectedIndex]; > > > > if(option.value == 8 || option.value == 12) { > > > > var inputs = fraudServiceDiv.getElementsByTagName("INPUT"); > > for(var i = 0; i < inputs.length; i++) { > > if(inputs[i].type == 'checkbox' && inputs[i].checked) > > { > > valid = true; > > break; > > } > > } > > } else { > > valid = true; // Line 86 > > } > > > > return valid; > >} > > > ></script> > > > >The error: > > > >Tag <> on line 86 contains more than one 'valid' attribute. > >location: context:/WEB-INF/investigation/InvestigationDetail.html, line 86 > >81 valid = true; > >82 break; > >83 } > >84 } > >85 } else { > >86 valid = true; > >87 } > >88 > >89 return valid; > >90 } > >91 > > > >Stack Trace: > >org.apache.tapestry.parse.TemplateParser.templateParseProblem(TemplateParser.java:391) > > > >org.apache.tapestry.parse.TemplateParser.addAttributeIfUnique(TemplateParser.java:889) > > > >org.apache.tapestry.parse.TemplateParser.startTag(TemplateParser.java:783) > >org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:494) > >org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:326) > >$ITemplateParser_1080ba0d7fa.parse($ITemplateParser_1080ba0d7fa.java) > >$ITemplateParser_1080ba0d7fb.parse($ITemplateParser_1080ba0d7fb.java) > >org.apache.tapestry.services.impl.TemplateSourceImpl.constructTemplateInstance(TemplateSourceImpl.java:339) > > > > > >I am not sure what this error means. > > > >Thanks, > >Amir > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- The Spindle guy. http://spindle.sf.net Get help with Spindle: http://lists.sourceforge.net/mailman/listinfo/spindle-user Announcement Feed: http://www.jroller.com/rss/glongman?catname=/Announcements Feature Updates: http://spindle.sf.net/updates --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
