Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8815261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:19:54+00:00 2026-06-14T04:19:54+00:00

I am doing this in JavaScript: function doClick() { var theValue = document.getElementById(theForm:theField).value; var

  • 0

I am doing this in JavaScript:

function doClick() {
  var theValue = document.getElementById("theForm:theField").value;
  var theLength = theValue.length;

  if( theLength <= 3 )  --> Error
  {
    alert('Character length too small.');
  }
}

And thefield is a JSF component:

<h:form id="theForm">
  <h:commandButton id="theField" action="#{theBean.doFunctionA}" onclick="doClick()"/>

When I render this in IE, it show me this error:

Caused by: javax.faces.view.facelets.FaceletException: Error Parsing /viewMetadata/pages/thePage.xhtml: Error Traced[line: 66] The content of elements must consist of well-formed character data or markup.
    at org.apache.myfaces.view.facelets.compiler.SAXCompiler.doCompileViewMetadata(SAXCompiler.java:716)
    at org.apache.myfaces.view.facelets.compiler.Compiler.compileViewMetadata(Compiler.java:126)
    at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createViewMetadataFacelet(DefaultFaceletFactory.java:311)
    at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getViewMetadataFacelet(DefaultFaceletFactory.java:394)
    at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getViewMetadataFacelet(DefaultFaceletFactory.java:376)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage._getViewMetadataFacelet(FaceletViewDeclarationLanguage.java:1940)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.access$000(FaceletViewDeclarationLanguage.java:129)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage$FaceletViewMetadata.createMetadataView(FaceletViewDeclarationLanguage.java:2049)
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:161)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
    ... 52 more

If I replace the error line with this:

if( theLength == '3' || theLength == '2' || theLength == '1')

Then everything is working fine. I don’t really understand what is actually happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:19:55+00:00Added an answer on June 14, 2026 at 4:19 am

    Given the error message:

    Caused by: javax.faces.view.facelets.FaceletException: Error Parsing 
    /viewMetadata/pages/thePage.xhtml: Error Traced[line: 66]
    The content of elements must consist of well-formed character data or markup.
    

    It sounds like it’s trying to parse it as XML. You should read up on what escaping you would usually need in JSF, but the first thing to try is just escaping it as XML:

    if (theLength &lt;= 3)
    

    When diagnosing the error, it’s important to realise that this isn’t actually hitting the browser’s Javascript engine – the problem is in generating the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could somebody please explain what this notation is in javascript? What is function(d) doing?
I'm doing some experimenting with this malicious JavaScript line: var undefined = true; Every
I have this javascript code: function checkUploadedFile() { var inputFile = $(#fuUploadProfile).val(); if (inputFile
I have a jQuery which is like this: <script type=text/javascript> $(document).ready(function () { $(#txtAgentName).click(function
I came across this JavaScript function and I don't understand quite what it's doing,
I need to set a cookie with javascript which I'm doing this with the
I got this message when doing some javascript programming, and after some google searches,
I am doing a comparison on dates in javascript. In this case date1 is
I am doing some exercises in my object-oriented javascript book, I notice that this:
I have the following script: <script type=text/javascript> $(document).ready(function(){ document.write(<script type=\text/javascript\ src=\http://site.com/script.js\><\/script>); }); </script> When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.