(BUG): using less than operator in javascript

I am using Jdeveloper 11.1.1.5.0, ADF BC, ADF Faces.
I am trying to add some java script validation in my page, just want to check if the length of an input field is less than three or not.
here is the function I used
function filterForNumbers(evt){
var inputField = evt.getSource();
var oldValue  = inputField.getValue();
var myField   = inputField.findComponent("it2");
var len = oldValue.length;
if (len < 3)      
   alert ("the length is <  3" );
   myField.setValue("");
}when I use the less then operator (<) in this part
if (len < 3)ADF frame work considers the < as an open tag and when I run the page, it shows this error message in the log
Error(16,16):  Illegal token.
and the page does not run.
workaround*
using this syntax instead
if (3 > len)

Thank again Sireesha,
I tried your suggestion with and without space. What I get is that the there is no thing on the page (only blank page is shown).
here is my page source
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view>
    <af:document id="d1" partialTriggers="it2">
      <af:resource type="javascript">
       function filterForNumbers(evt){
       var inputField = evt.getSource();
       var oldValue = inputField.getValue();
       var myField = inputField.findComponent("it2");
       var len = oldValue.length;
       if (len &lt 3)      
         alert ("the length is <  3" );
         myField.setValue("");
      </af:resource>
      <af:messages id="m1"/>
      <af:form id="f1">
        <af:panelFormLayout id="pfl1">
          <af:inputText value="#{bindings.Id.inputValue}"
                        label="#{bindings.Id.hints.label}"
                        required="#{bindings.Id.hints.mandatory}"
                        columns="#{bindings.Id.hints.displayWidth}"
                        maximumLength="#{bindings.Id.hints.precision}"
                        shortDesc="#{bindings.Id.hints.tooltip}" id="it1">
            <f:validator binding="#{bindings.Id.validator}"/>
            <af:convertNumber groupingUsed="false"
                              pattern="#{bindings.Id.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Description.inputValue}"
                        label="#{bindings.Description.hints.label}"
                        columns="#{bindings.Description.hints.displayWidth}"
                        maximumLength="#{bindings.Description.hints.precision}"
                        shortDesc="#{bindings.Description.hints.tooltip}"
                        id="it2" required="true">
            <f:validator binding="#{bindings.Description.validator}"/>
            <af:clientListener method="filterForNumbers" type="valueChange"/>
          </af:inputText>
          <af:inputText value="#{bindings.Flag.inputValue}"
                        label="#{bindings.Flag.hints.label}"
                        required="#{bindings.Flag.hints.mandatory}"
                        columns="#{bindings.Flag.hints.displayWidth}"
                        maximumLength="#{bindings.Flag.hints.precision}"
                        shortDesc="#{bindings.Flag.hints.tooltip}" id="it3">
            <f:validator binding="#{bindings.Flag.validator}"/>
          </af:inputText>
          <f:facet name="footer">
            <af:panelGroupLayout layout="vertical" id="pgl2">
              <af:panelGroupLayout layout="horizontal" id="pgl1">
                <af:commandButton actionListener="#{bindings.First.execute}"
                                  text="First"
                                  disabled="#{!bindings.First.enabled}"
                                  partialSubmit="true" id="cb3"/>
                <af:commandButton actionListener="#{bindings.Previous.execute}"
                                  text="Previous"
                                  disabled="#{!bindings.Previous.enabled}"
                                  partialSubmit="true" id="cb4"/>
                <af:commandButton actionListener="#{bindings.Next.execute}"
                                  text="Next"
                                  disabled="#{!bindings.Next.enabled}"
                                  partialSubmit="true" id="cb5"/>
                <af:commandButton actionListener="#{bindings.Last.execute}"
                                  text="Last"
                                  disabled="#{!bindings.Last.enabled}"
                                  partialSubmit="true" id="cb1"/>
              </af:panelGroupLayout>
              <af:commandButton text="Submit" id="cb2"/>
            </af:panelGroupLayout>
          </f:facet>
        </af:panelFormLayout>
      </af:form>
    </af:document>
  </f:view>
</jsp:root>

Similar Messages

  • Problems using ' ' (less than) symbol in JavaScript

    Using JSC EA 2 and I can't use the less than operator '<' in JavaScript.
    When I use an expression such as
    if( a < 10 )
    I get an error saying
    "The content of the elelments must contain well-formed character data or markup"
    However, if i change that to
    if( 10 > a )
    I have get no error and everything works fine.
    Anyone else experience this "feature"

    Hi,
    Use the following code clip (withing opening & closing ) wherever you want to use JavaScript in JSC.<script language="JavaScript" type="text/javascript"><![CDATA[
    // Drag onto the JSP Source -- usually within the <head> tag
    // Your JavaScript code goes here, for example
    function postMessage(message) {
    alert(message)
    ]]></script>
    You can create a code clip on JSC palette for later use.

  • Using '(' and less than operator in an xsql page sql query

    Dear All,
    I tried to use left parenthesis '(' and less than operator in an sql query through an xsql page, it doesn't let to use them.
    Do you know how to use those in an xsql page?
    Thanks for your help.
    Mustafa

    Following is the xsql page that I tried to run:
    <?xml version="1.0"?>
    <xsql:query xmlns:xsql="urn:oracle-xsql" connection = "bib" rowset-element="bib" row-element="book">
    (SELECT year,title,last,first,' ' as affiliation,publisher,price
    FROM book,author
    WHERE year=2001 and bookid=parentid
    UNION
    SELECT year,title,last,first,affiliation,publisher,price
    FROM book,editor
    WHERE year=2001 and bookid=parentid)
    INTERSECT
    (SELECT year,title,last,first,' ' as affiliation,publisher,price
    FROM book,author
    WHERE publisher='Publisher1' and bookid=parentid
    UNION
    SELECT year,title,last,first,affiliation,publisher,price
    FROM book,editor
    WHERE publisher='Publisher1' and bookid=parentid)
    </xsql:query>
    This is the error message generated after running:
    <ERROR>java.sql.SQLException: ORA-01009: missing mandatory parameter</ERROR>
    When I remove the parentheses it works but this results in a different result set.
    Can anybody tell me the reason?
    Thanks,
    Mustafa
    null

  • Why did I receive an e-mail saying I have exceeded my storage when I am using less than 1 GB

    why did I receive an e-mail saying I have exceeded my storage when I am using less than 1 GB?

    Thanks: our creatives said they would research "with Apple" and let us know next week when we are there for training, so you are correct we probally don't need the Genius Bar, but since we're at the Apple store for training it's good to keep in touch with them as they always have some good tips or advice.
    Plus if they get to know you you seem to get better service

  • So With All my apps i am using less than 300mb no music no videos, but my iPad is saying that I have used 13.1gb how can I get that lost space?

    So With All my apps i am using less than 300mb no music no videos but my iPad is saying that I have used 13.1gb how can I get that lost space?

    Did you confirm this in Settings>General>Usage>Storage? You can see how much storage space each app is taking up. If that checks out with your findings, then your space is probably being taken up by "other". You can see this when you connect your iPad to your computer and with iTunes running. You can see it in the capacity bar at the bottom of the iTunes window on the right side.
    "Other" contains most of the stuff associated with apps but not the apps or any media itself. Safari history and bookmarks, contacts, notes, text messages, email messages and so on. When "other" takes up that much space, something is wrong and usually restoring the iPad will clear that up.
    Backup the iPad, transfer purchases, restore to factory settings, restore from the backup and then sync with iTunes to retrieve everything.
    iTunes: Restoring iOS software - Support - Apple

  • Xpath query using greater than operator

    I'm trying to evaluate some xml to determine if it matches some criterium.
    MyXmlColumns contains the following kind of data "<Values><Value>data1</Value><Value>data2</Value><Values>"
    When I execute the following query I get zero rows returned when it should match some rows containing this data.
    select * from mydata
    where existsNode(MyXmlColumn, '/Values/Value[. > "data1"]') = 1
    The question is why greter than, lesser than, does not work, and if there is any alternative.
    If I use equals operator, or greater than but using a number it works.
    I know that I can use XmlExists function but I'm using Oracle 9i r2 so it's not an option.
    Thanks in advance for any suggestion.

    but I'm using Oracle 9i r2
    The question is why greter than, lesser than, does not workWorks on 9.2.0.8:
    SQL> select * from v$version where rownum = 1
    BANNER                                                         
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    1 row selected.
    SQL> with mydata as
       select xmltype('<Values><Value>data1</Value><Value>data2</Value></Values>') MyXmlColumn from dual
    select * from mydata t where existsNode(t.MyXmlColumn, '/Values/Value') < 3
    MYXMLCOLUMN                                                              
    <Values>                                                                 
      <Value>data1</Value>                                                   
      <Value>data2</Value>                                                   
    </Values>                                                                
    1 row selected.

  • Bug with less than in EL?

    Less than comparision is behaving strange, I tried this:
    <c:set var="minSum" value="99" />
    <c:set var="sum" value="1000" />
    <c:out value="${sum < minSum}" />
    This displays "true" on the webpage, but should obiously display "false".
    Is this a known bug?

    Never mind, I figured it out.
    I compared strings, I have to use numbers like this:
    <fmt:parseNumber value="99" var="minSum"/>
    <fmt:parseNumber value="1000 var="sum"/>
    <c:out value="${sum < minSum}" />

  • Using less than or equal and greater or equal relational operators in BIP

    Hi,
    I have a query wherein I am using a relational operator '<=' and '>='. When I run my sql query in TOAD in works fine but when I put it in BIP using a Data Template, it says "Data Template XML is invalid". When I try to remove the '<' and the '>' signs the query is working but of course the output is incorrect.
    My question is, what's the syntax in BIP Data Template for operators '<=' and '>='.
    Will really appreciate anyone's help.
    Thanks :)
    Ann

    Yeah this was the first thing I tried when I began to suspect my soundcard was causing the freezing and screeching while playing MTW 2 but as you can see here, I managed to get my card on it's own IRQ but the problem persists as ever.
    [img"]http://img82.imageshack.us/img82/8908/wl6.gif[/img]
    Truly extrordinary.

  • Does Less Than ( ) operator works in the data template SQL within CDATA ??

    All,
    I am trying to use <= operator (<= sysdate) in the data template sql query and it's throwing Java exceptions.
    I have CDATA around my sql and XML parser should ignore '<' symbol. Query works fine if I use 'ampersandlt;=' operator. Here is my query
    <sqlStatement name="Q_1" dataSourceRef="">
    <![CDATA[select * from table where date_column <= sysdate]]>
    </sqlStatement>
    Just want to know if this is a bug.
    Thanks
    Problem was solved. Use 'ampersandlt;' where ampersand is '&' for less than

    Try this..
    select * from table where date_column <= sysdate

  • Less Than operator not working, Greater Than operator works comparing dates

    I need to compare dates to conditionally display a row. If the DateDueJulian_ID5<= AsOfDate_ID47 display otherwise don't. I get all rows but if I reverse the logic >= the condition works and only displays the one matching row.
    I am using the Template Builder 10.1.3.4.1 and WORD 2007.
    Any help is appreciated!
    Thanks
    XML Source:
    <Header_Section_S3>
    <Delinquency_Report_ID225>DELINQUENCY NOTICE</Delinquency_Report_ID225>
    <VersionName_ID270>0001</VersionName_ID270>
    <Report_or_Video_Title_ID53></Report_or_Video_Title_ID53>
    <Remit_To_Text_ID68>Remit To:</Remit_To_Text_ID68>
    <RemitToAddressLine1_ID2>XXXXX</RemitToAddressLine1_ID2>
    <XX_XX_XX_ID259>2010-08-25</XX_XX_XX_ID259>
    <Date__ID258>Date</Date__ID258>
    <RemitToAddressLine2_ID5></RemitToAddressLine2_ID5>
    <RemitToAddressLine3_ID8></RemitToAddressLine3_ID8>
    <As_of_Date__ID46>As of Date</As_of_Date__ID46>
    <AsOfDate_ID47>2007-11-29</AsOfDate_ID47>
    <A_R_Delinquency_Notice_Detail_Join_S2>
    <DocVoucherInvoiceE_ID1>1897265</DocVoucherInvoiceE_ID1>
    <DateInvoiceJ_ID3>2007-10-11</DateInvoiceJ_ID3>
    <DateDueJulian_ID5>2007-12-10</DateDueJulian_ID5>
    <NameRemark_ID7></NameRemark_ID7>
    <AmountOpen_ID11></AmountOpen_ID11>
    <AddressNumber_ID17></AddressNumber_ID17>
    <UniqueKeyIDInternal_ID19></UniqueKeyIDInternal_ID19>
    <KAV_CustomerPONumber_ID23></KAV_CustomerPONumber_ID23>
    </A_R_Delinquency_Notice_Detail_Join_S2>
    <A_R_Delinquency_Notice_Detail_Join_S2>
    <DocVoucherInvoiceE_ID1>1897265</DocVoucherInvoiceE_ID1>
    <DateInvoiceJ_ID3>2007-10-11</DateInvoiceJ_ID3>
    <DateDueJulian_ID5>2007-11-10</DateDueJulian_ID5>
    <NameRemark_ID7></NameRemark_ID7>
    <AmountOpen_ID11></AmountOpen_ID11>
    <AddressNumber_ID17></AddressNumber_ID17>
    <UniqueKeyIDInternal_ID19></UniqueKeyIDInternal_ID19>
    <KAV_CustomerPONumber_ID23></KAV_CustomerPONumber_ID23>
    </A_R_Delinquency_Notice_Detail_Join_S2>
    RTF:
    <?for-each:Header_Section_S3?>
    <?if:DateDueJulian_ID5 <= AsOfDate_ID47?>
    <?DocVoucherInvoiceE_ID1?>
    <?DateDueJulian_ID5?>
    <?AsOfDate_ID47?>
    <?end if?>
    <?end for-each?>

    Found the solution! Use Date_Diff.
    <?if:xdoxslt:date_diff('d',DateDueJulian_ID5,AsOfDate_ID47,$_XDOLOCALE,$_XDOTIMEZONE)>=0?>

  • Less than operator misbehave

    The values came from (string to number) pattern match and were misbehaving.
    After tinkering with type casting and formats (didn't spend much time though), there was no change in wrong evaluation:
    Message Edited by labview-programmer on 06-04-2010 10:19 PM
    Message Edited by labview-programmer on 06-04-2010 10:21 PM
    Best,
    Aniket
    Solved!
    Go to Solution.
    Attachments:
    wrong evaluation.vi ‏6 KB

    No it works. And this is common problem then working with floating point numbers :smileyvery-happy: The problem are caused by small rounding errors. The number format is the source of the trouble. It has been a lot of postings about this
    Use the in range check instead.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • I TRY TO DO INTERNET BANKING WITH KOREA BASED BANK, BUT I NEED TO USE LESS THAN FIREFOX 9.0. MY COMPUTER IS FIREFOX 10.0.

    hi, i try to use firefox to connect my bank information in Korea where i recently registered for internet banking. But , as soon as i get into that website, a window showing that i can not use this browser because it has to be firefox 3.5-9.0. Mine is firefox 10.0.Is there any way to downgrade this number?

    Hey INJOOYON,
    There are a lot of benefits to running the latest version of Firefox. You might want to consider running the older version on [http://portableapps.com/apps/internet/firefox_portable/localization#legacy36 a USB Stick with PortableApps]. That way you'll still be able to run the latest version for your day to day activities.
    You could also try User Agent Switcher: https://addons.mozilla.org/firefox/addon/user-agent-switcher/
    If you still want to roll back to a previous version of Firefox, just take a look at the Knowledge Base article [[Installing a previous version of Firefox]].
    Hopefully this helps!

  • I get "File failed to convert" in ExportPDF Online when the file is only 356 KB and I've used less than 9 MB of storage.

    How do I get it to convert?

    Hi JC Schochet,
    Do other files convert without error? How complex is the file that you're trying to convert (even when files are well within the file size limit of 100 MB, complexity can cause the ExportPDF service to time out before it converts the entire file).
    Here are some things to try:
    Move files in the root folder of your Acrobat.com account into a subfolder, and then try again.
    Clear the browser cache.
    Try a different web browser.
    Disable OCR as described in this document: How to disable Optical Character Recognition (O... | Adobe Community
    Please let us know how it goes.
    Best,
    Sara

  • Getting error message stating lack of disc space, but have only used less than 1GB of 20GB idisc space and been publishing fine until this month

    Why can't I send and email and get an answer to a problem that is clearly personal to my idisc.  What is the point of paying for Apple Care when you can't contact them when they stop access to products that you have already paid for.  I am travelling and I cannot contact them by phone.

    Try the following:
    close iWeb.
    delete the iWeb preference file, com.apple.iWeb.plist, that resides in your Home/Library/Preferences folder.
    go to your Home/Library/Caches/com.apple.iWeb folder and delete its contents.
    launch iWeb and try again.
    If that doesn't help continue with:
    move the domain file from your Home/Library/Application Support/iWeb folder to the Desktop.
    launch iWeb, create a new test site, save the new domain file and close iWeb.
    go to the your Home/Library/Application Support/iWeb folder and delete the new domain file.
    move your original domain file from the Desktop to the iWeb folder.
    launch iWeb and try again.
    OT

  • IPhoto book: Can I use less than 20 pages? and other questions...

    Is 20 pages the minimum? I have just eleven photos. Is there a workaround for this? Also, the iPhoto preview looks fine, but I'm wondering what the file specs need to be. My original files are approx. 15 MB TIFF. Should they be jpeg? Resized? Does iPhoto (or Kodak) do this automatically? Thanks for any help.

    TW3:
    Welcome to the Apple Discussions. 20 pages is the minimum. I think it's due to the minimum number of pages that can be bound. I really doesn't matter about the tiff files as iPhoto creates a PDF file for uploading and printing. Just be sure they are RBG and not CMYK.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.

Maybe you are looking for