Textarea validation with max only

How can I set up my textarea validation so that there is no
minimum but the IS a maximum number of characters?
I tried setting min to zero bas below but it doesn't work.
It gives an error unless I try ONE character.
var theDescription = new
Spry.Widget.ValidationTextarea("theDescription",
{useCharacterMasking:true, minChars:0, maxChars:180,
counterType:"chars_count", counterId:"Countvalidta1",
validateOn:["change"]});

Hi Kate,
As Dragos suggested you should add the isRequired: false.
This will tell to the Validation Textarea to simply ignore the fact
the textarea value is empty.
Then if you completely remove the the minChars then you
should obtain the behavior you expected. If any numerical value is
passed through the minChars then the length of textarea value is
validated against that value. Instead if you remove the option the
Validation Widget will simply stop make the check.
Into the documentation you have detailed examples for the
different options that could be used for the textarea widget:
http://labs.adobe.com/technologies/spry/articles/textarea_overview/
Regards,
Cristian MARIN

Similar Messages

  • Textarea with Read Only Condition Type

    A have a textarea (database field with Varchar2(4000) with the Read Only Condition Type set to Request != Expression 1. Works fine, except that data presented as a long 1 line text (like a Displayed text) when condition meet (no vertical scrollbar).
    Am i missing some additional settings.

    the easiest way to get the read-only version of your textarea item to appear more like your read/write version is to add some style specifications into the "Read Only Element Table Cell(s) Attributes" field that's right below where you specified your read-only conditions ("Expression 1" and "Expresssion 2"). as the name suggests, values entered into that field end up in the table data tag for the cell in which your read-only content is placed. added style specifications for height and width would help you control how the text is spread across your page. you can/should also consider using background and color style attributes to color the table cell the way we're used to seeing read-only data ("grayed out"). so though my colors are way off, a string like this...
    style="width:16px;height:30px;background:#C5D5C5;color:666666;font-weight:bold;font-size:12pt"
    ...in that "Read Only Element Table Cell(s) Attributes" field would format your read-only data closer to what you're going for. at the least, it'd give you an idea for the type of control you have.
    for extremists, there's also another approach: if you want absolute and total control over the way your textarea item's data is displayed, you could display your item's data in an HTML region instead of as the item directly. for instance, you mentioned you liked that scroll bar. you could achieve the scroll bar by defining your table, the scroll bar class, and table cell in an HTML region. say we saved your textarea item's data to a hidden item called P1_MY_TEXTAREAS_DATA. i'm pretty sure this html would let you show that data in that scrollable non-updatable format you're shootin' for...
    <style type="text/css">
    .scrollarea{
    font-size: 10pt;height:250px;width:100%;text-align:left;
    background-color:#ffffff;color:black;padding:0px 0px 0px 0px;margin:0px;overflow: auto;
    float:left;}
    </style>
    <div class="scrollarea">
    <table summary="" width="100%"><tr>
    <td style="width:16px;height:300px;border:4px;margin-left:4px;margin-right:9px">
    &P1_MY_TEXTAREAS_DATA
    </td></tr></table><div>
    ...see? by defining your own table, you get the easy opportunity to wrap it in those div tags that call the scrollarea class. also note that i just referenced the content of your textarea item with that ampersand syntax (&P1_MY_TEXTAREAS_DATA). you could, of course, keep things cleaner by defining your scrollarea class in a css, but that's your call.
    hope this helps,
    raj

  • Only ibooks opened, with the book, then button publish, at the validation stage one only i see  : warning error saving application

    only ibooks opened, with the book, then button publish, at the validation stage one only i see  : warning error saving application

    Search the discussion groups or read more of teh  threads in the list...  this  problem has been rasied many times in teh last  few days and the "cures" are many and varied.

  • Spry Textarea validation extension to prevent spam

    I am using the fairly limited features of the spry framework in Dreamweaver to validate forms.
    When I get to the textarea, validation is limited to:
    required
    min char, char count
    AND NOT MUCH MORE!
    I would like to continue to use the spry framework since it is pervasive inside DW CS4 and seems useful - BUT I need to be able to add functionality.
    Specificly I would like to check the textarea for content matching a regx string. To determin if the form is getting hit by a spam bot.
    I can do this in PHP, like so;
    <?PHP
    // Spam Detection code block
    // The \b in the pattern indicates a word boundary, so only the distinct
    //word "web" is matched, and not a word partial like "webbing" or "cobweb" */
    // Check for html and img tags in string
    function check($comment) {
      // if(ereg('(href=\b|http\b|url=http\b|<a href|<IMG=|<img|img=|scr=|www\b)@i', $comment)) {
      if (preg_match('(href=\b|http\b|url\b|http\b|<a href|<IMG=|<img|img\b|scr\b|www\b)i', "$comment")) {
          // comment looks dirty, lets put up a bogus thankyou.
          echo("<pre> 
         </pre><center> Thanks <p>We have received your comment and hope you enjoyed visiting our site. <p>To continue browsing, use the links above.</center>");
    exit();
    else{ // comment is clean of URLs
    // End of Spam Detection code block 
    ?>
    Is there a way to integrate this code (or similar javascipt) into the Spry library, so I can do this in DW?
    Anti spam technologies are a very important part of forms these days.
    I hope other people value this request and pipe up about it.
    Thanks
    -Daniel Hoviss

    Never mind. After doing some experimenting, it turns out it's
    something in my company's template that is conflicting with
    something.
    Now I just have to figure out what it is.

  • XML validation with JDOM / JAXP

    Hello,
    I am trying to validate xml file against schema file. I decided to use JDOM and JAXP.
    First question: is it a good choice?
    I did a first attempt but not sure I have understood all what I am doing :(
    First I have create a parser usinf org.jdom.*
    SAXBuilder parser = new SAXBuilderThen I built my document:
    Document doc = parser.build(myFile)These 2 steps are ok. But it does not do validation.
    I saw in the JDOM documentation that I can set a validation flag to true. I did it. First problem, I got the following error from JDOMException: Document is invalid: no grammar found.
    Is there a way to specify to the parser where to find the xsd file?
    As I did not find answer to this question by myself, I tried implementing the Schema class from JAXP:
    SAXBuilder parser = new SAXBuilder;
    Document doc = parser.build(myFile);
    Schema schema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile);
    ValidatorHandler vh = schema.newValidatorHandler();
    SAXOutputter so = new SAXOutputter(vh);
    so.output(doc);It does the validation against the schema file specified but I am not really sure about what I am doing here. The last 2 commands are not clear to me :(
    Then in my schema file, I have elements that have default value. I expected the following behavior: if the element is not in the xml file then the default will be used by the parser (and added in the tree). But it seems, it's not the case.
    Any help/explanation will be really appreciated.

    I am trying to validate xml file against schema file. I decided to use JDOM and JAXP.
    First question: is it a good choice?
    If only schema validation is required use the validation API in JDK 5.0.
    http://www-128.ibm.com/developerworks/xml/library/x-javaxmlvalidapi.html
    http://java.sun.com/developer/technicalArticles/xml/validationxpath/
    For validation with JDOM, the following validation application explains the procedure:import org.jdom.input.SAXBuilder;
    import org.xml.sax.SAXException;import org.jdom.*;
    import java.io.*;
    public class JDOMValidator{
    public void validateSchema(String SchemaUrl, String XmlDocumentUrl){
               try{
    SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser",true);<br/>saxBuilder.setValidation(true);
    saxBuilder.setFeature("http://apache.org/xml/features/validation/schema",true);
    saxBuilder.setFeature("http://apache.org/xml/features/validation/schema-full-checking",true);
    saxBuilder.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",SchemaUrl);
    Validator handler=new Validator();
    saxBuilder.setErrorHandler(handler);
    saxBuilder.build(XmlDocumentUrl);
    if(handler.validationError==true)
    System.out.println("XML Document has Error:"+handler.validationError+""+
    handler.saxParseException.getMessage());      
    else           
          System.out.println("XML Document is valid");
              }catch(JDOMException jde){
                }catch(IOException ioe){
    private class Validator extends DefaultHandler{     
         public boolean  validationError = false; 
         public SAXParseException saxParseException=null;    
      public void error(SAXParseException exception) throws SAXException{        
         validationError =true;
         saxParseException=exception; 
      public void fatalError(SAXParseException exception) throws SAXException  {
    validationError = true;     
    saxParseException=exception;
      public void warning(SAXParseException exception) throws SAXException       {
    public static void main(String[] argv)   {
       String SchemaUrl=argv[0];StringXmlDocumentUrl=argv[1];
       JDOMValidator validator=new JDOMValidator();
       validator.validateSchema(SchemaUrl,XmlDocumentUrl);
    }

  • IW32 - restriction or validation to accept only internal order from a plant

    HI team!!
    I´m needing your help
    Im working with Tcode IW32 when creating a maintenance order and we got through Goto / Settlement rule we can assign any internal order number.
    there is no restriction or validation to accept only internal order numbers from the corresponding plant, this condition may affect other entities
    How can I limit it?
    Thks & regards "

    In configuration, in settlement rule, restrict receiver other than internal order. In case if you want to have internal order as a receiver but restrict only some orders, you can do that using a user exit/badi at save.
    example user exit -IWO10009

  • Using Validator with mx:ComboBox causes it to auto-close

    I've recently ported a 3.x flex app to Flex 4. I've run in to a bug that causes all mx:ComboBoxes to close the first time the user attempts to open the drop down list. Subsequent attempts to open the box work fine.
    Example:
    <mx:ComboBox id="typeId" dataProvider="{fMechanismTypes}"
                                 labelField="name" prompt="Select..."
                                 change="handleTypeChange( )"
                                 creationComplete="initTypeValidator();"
                                 focusOut="tabValidationCheck()"/>
    private function initTypeValidator():void {
                fTypeValidator.source = typeId;
                fTypeValidator.property = "selectedIndex";
                fTypeValidator.minValue = 0;
                fTypeValidator.lowerThanMinError = "This field is required.";
    If I don't initialize fTypeValidator, the combobox works correctly.
    Anyone experience this?

    It appears a Flex ComboBox and a String Validator with the properties of being required as true, and the property of text, forces the ComboBox to close when selecting an item via the keyboard.  This auto close only happens when making the initial selection from the initial empty string or 0 index.  After a valid selection has been made, the user is able to use the keyboard to select any other values, and the ComboBox display remains open.  I have attempted to write my own ComboBox class that extends the Flex ComboBox, which would do custom open and close functionality, however I have been unsuccessful.  My goal is to have this ComboBox remain open during Keyboard input.  If the StringValidator required property is set to false, the box does not auto close.
    Any help on this topic would be greatly appreciated.
    And here is a sample of my code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"  layout="absolute" minWidth="955" minHeight="600" creationComplete="init();">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]private var _comboBoxDataProvider:ArrayCollection;
                private function init():void {
                    _comboBoxDataProvider = new ArrayCollection();
                    _comboBoxDataProvider.addItemAt('', 0);
                    for(var i:int = 0; i < 6; ++i) {
                        var obj:Object = {};
                        obj.labelField = String(i);
                        _comboBoxDataProvider.addItem(obj);
                    comboBoxValidator.validate();
            ]]>
        </mx:Script>
        <mx:StringValidator id="comboBoxValidator"
            required="true"
            source="{comboBox}" requiredFieldError="Empty Field Error"
            property="text"
            />
        <mx:ComboBox  id="comboBox" width="150"
        dataProvider="{_comboBoxDataProvider}"
        labelField="labelField"
        selectedIndex="0"  />
    </mx:Application>

  • How to do validation with a class that extends DispatchAction?

    I'm trying to mess around with some validation with struts for a .jsp form and I've read a tutorial that says I need to extend ValidatorForm instead of ActionForm...however, I'm using DispatchAction instead of ActionForm. What is the best way to do validation if I'm using a DispatchAction?
    Thanks a lot.

    Hey evnafets,
    I do have the struts validator configured in the struts config file, and I do get the following message:
    Jun 21, 2005 10:06:55 AM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    Jun 21, 2005 10:06:55 AM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    I added the <form-set> tags but am still getting nothing, I'm now wondering if it may have something to do with the following, which I just noticed...
    In my .jsp file, I have something like this:
    <html:form action="/modifyBook">
    <html:errors />
    <b>Name: </b><html:text property="fname" value="${entry.fname}"/> <html:text property="lname" value="${entry.lname}" /><br/>
    <html:hidden property="method" value="edit"/>
    <html:submit property="submitValue">Edit</html:submit>
    <html:cancel property="cancelValue">Cancel</html:cancel>And in the "edit" method of the ModifyBookAction class, I cast the form into a DynaValidatorForm and just have my code to perform the edit. Now, what I'm wondering is, is the form getting properly associated with a "ModifyBookForm" which is what the rules are written for? The only tie I see is in the struts config where there is this:
          <action        
             name="ModifyBookForm"
             parameter="method"
             path="/modifyBook"
             scope="request"
             type="com.yourcompany.struts.action.ModifyBookAction"
             validate="true">
             <forward
                  name="failure"
                  path="/form/error.jsp"
                  redirect="true"/>
             <forward
                name="success"
                path="/loadBook.do"
                redirect="true" />
          </action>Is this enough? I'm thinking that the validation may be set up correctly, I'm just not implementing it in the right way?
    Thanks again

  • Apex textarea validation

    hi :
    i have one textarea .in this textare i am typing only sql-select statement.like any sql select statement .when i am clicking the query button .it is showing report related what we typed the query..what is my requirement .in this text area allow only the select statement ..do not allow any other DML AND DDL statement.for this i want to do validation..pls give me solutions.....

    Hi Anbarasan,
    This might be not a proper solution but just make a try.
    create a function
    substring the first word
    if it is Select return true rest return false.
    call the function in the query button .
    bye
    Srikavi

  • This is an example of schema validating with error feedback

    Hi,
    Hope this is of help....
    This is an example of schema validating WITH error feedback
    public boolean validate(InputStream is) {
    // create and setup the DOM parser object
    parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.setValidationMode(XMLConstants.SCHEMA_STRICT_VALIDATION);
    boolean isValid = false;
    if (is != null) {
    try {
    parser.parse(new InputSource(is));
    isValid = true;
    } catch (XMLParseException e) {
    for (int i = 0; i<e.getNumMessages() ;i++){
    System.out.println("XMLParseException nr:"+new Integer(i+1)+" \'imsmanifest.xml\' line nr: "+new Integer(e.getLineNumber(i))+" col nr:"+
    new Integer(e.getColumnNumber(i))+" (formatErrorMessage: "+e.formatErrorMessage(i)+") ["+e.getMessage(i)+"]");
    } catch (java.io.IOException e) {
    System.out.println("IOException: Error creating input source [" + e.getMessage() + "]");
    } catch (org.xml.sax.SAXException e) {
    System.out.println("SAXException: Error parsing [" + e.getMessage() + "]");
    } catch (Exception e){
    System.out.println("Exception: Error parsing [" + e.getMessage() + "]. ");
    doc = parser.getDocument();
    return isValid;
    regards
    Jon

    "personally, I'd just put the exception handling into the package."
    Maybe I am making this over-complicated. I would like all the error handling in the package. It seems like putting an ONSERVERERROR trigger would be a little overkill, and if it fires on every database error, and I have to screen for only my errors seems like a little overkill and to me, it seems like it would incur quite a bit of overhead for the database seeing it is firing for every error. I don't even know if I would ultimately be allowed to keep it.
    Really, all I would want to do is:
    1) Handle the error and recover if possible
    2) If it is a fatal error, have a way to abort the package gracefully with some kind of record of it.
    3) Allow for the possibility of non-fatal errors or messages, even that I might generate myself to be able to be logged.
    This package has about 20 procedures now. If I have an error (particularly fatal), in let's say, procedure 8, I don't even know what happens. I don't know if by default it aborts the whole package or just that procedure or just keeps going. Is it possible to get just hung up and sit there?
    Thanks for the input.

  • Entity validation with groovy expression

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    I have an entity object with two attributes "status" and "reason".
    Only in case the user select status id "4" I would like to validate that he will select also reason.
    for this I was trying to add entity validation with groovy expression.
    so I added this expression "Status== 4 && Reason == null" and also I added failure message.
    But it doesn't work as I expected.
    The error is displayed every time, also when the user select status that is not 4 and also when he select status 4 and the reason is not null.
    How should I write this groovy expression?
    Thanks

    Just to clarify,
    If you add this validation to your status attribute then it will validate that Reason is not null when you change the status to 4.
    If you want to raise an entity validation just add a new Entity Validator and the expression should be something like what you had:
    But slightly different
    Status != null ? (Status==4? (Reason!=null) : true) : true

  • Xerces2_6_2 validating with dtd and schema.. please help

    Hi I am having trouble validating an xml document using xerces2_6_2
    I have a DTD that containes only entity references, and a schema that is used to ensure the xml is valid.
    I get this error.
    Element type "my root tag" must be declared!
    It seems to expect all validation grammer to be in the dtd. I have sucessfully validated with xml spy and oxygen,(oxygen uses xerces too).
    This is a real pain I really would lie to take advantage of using schemas, I know I could just use entity references in this form and not have a dtd but this is really not acceptable.
    I have tried out all the xerces specific properties and features but this has not worked either.
    Perhaps I should implement a validator? Does anyone have any ideas?
    thanks

    My solution, I thought to take, wasn't the right way, but I have found following thread within the forum
    http://forum.java.sun.com/thread.jspa?forumID=34&threadID=527461
    The problem you have described points to a dtd error. Considering the thread above, it would make sense. It is a presumption, but perhaps that is because of the new Xerces version. I would try with an older one.
    Sorry, that I could help you along.

  • Validation with data file failed

    Hello All
    I have loaded the Currency Exchange Rates from BW cube into Rate Model in BPC upto March 2014 and then our BW cube get updated the Exchange Rates for April 2014.
    Now I am trying to load the Exchange Rates for April 2014 only into Rate model and for that I am validating the Transformation File but it was failed. It shows 'VALIDATION WITH DATA FILE FAILED'.
    Rejected list option showing blank screen.
    With the same Transformation file I have loaded the data upto March 2014 successfully.
    I have compressed the source cube, reactivate the source cube after all am unable to validate the Transformation file. Below is my transformation file screen shot.
    Please let me know if you need any more details from my side.
    Thanku you all in advance.
    Please help
    Regards
    Srikant

    Hi Shaik
    Thanks for your reply.
    I have validate the Transformaiton file by given vlaue in MAXREJECTCOUNT= 10000 but there is no chage same error is coming. 'Validation with data file failed' without any errors.
    Thanks
    Srikant

  • How to do that - Validation with message

    Hi
    I have a litle app that validates one Portuguese Number (NIF).
    The purpose is create a textbox where the user put the number and then when press tue button, it validate then.
    I've tried do that with the validation, with a plsql function returnig boolean... it works fine when the number is wrong...
    the error message was fine... how can i implement a sucess message...
    Sugestions are welcome.
    Another question.... How can i costumize the standard error message?
    Sorry for the bad english
    Thanks

    José,
    Yes that would work. Because you're catching all of the incorrect entries with a validation, the PL/SQL process will never run unless you have the validation is TRUE. This means the process code can always complete successfully because the validation already did the work. So the process need be only one line:
    NULL;
    Then create the success message as you like and test it. Keep in mind that a process success message may look different from a validation failure message. You might have to modify the look a bit to get them consistent if that's necessary.
    Dan

  • Pb detection two cameras GigE with MAX on the same pc

    I installed on the same pc two GigE camera, each camera has its own interface card  (IP), but only one camera in dtected with max.
    sometimes cam0 and sometimes cam1.I have to carry out has each camera a fixed address IP but always only camera is detected.
    my question is how to make the configuration to appear both camera at the same time with max.
    I use the MAX version 5.3
    NI IMAQDX 4.0
    Think you very match for your help.
    Hamd2015
    Solved!
    Go to Solution.

    Hi Hamden,
    Could we get a little more information about your setup as it will help narrow down the issue?
    - What network interface cards (NIC) are you using?
    - What cameras are you using?
    - Are we running the cameras through a network or directly connecting them to the computer?
    - Can we see each camera when plugged in individually?
    - It sounds like you said that you are using a static IP address, but I wanted to confirm this.
    - Can we see both NICs in Windows Device Manger?
    Bill E. | Applications Engineer | National Instruments

Maybe you are looking for