Search Results

Search found 4868 results on 195 pages for 'grails validation'.

Page 7/195 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • email validation javascript

    - by fusion
    is this javascript function (checkValidity) correct? function checkTextBox(textBox) { if (!checkValidity(textBox.getValue())) displayError("Error title", "Error message", textBox); textBox.focus(); } function checkValidity(e) { var email; email = "/^[^@]+@[^@]+.[a-z]{2,}$/i"; if (!e.match(email)){ return false; else return true; } }

    Read the article

  • Zend framework currency validation

    - by Dan
    How can I validate (a form element in this case) to ensure that the value is a currency? Have looked at Zend_Validate_Float. Needs to check that value is between 0 and 2dp. Ideally locale-aware (as ZVF is) to allow for locale specific formatting (thousands, decimal as comma/dot) Would also want to extend to allow/disallow negative values And provide optional upper/lower limits. Is the key, as I can do 3. and 4. with a chain. Do I need regex?

    Read the article

  • validation using jquery

    - by fusion
    i'm trying to validate an html page using jquery, but nothing happens. it's a simple page, yet the textboxes aren't validated. this is the code: <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="~/jquery.js/"></script> <script type="text/javascript" src="~/jquery-validate/jquery.validate.js/"></script> <script type="text/javascript"> $(document).ready(function(){ var validator = $("#submitForm").validate({ debug: true, rules: { author: "required", quote: "required" }, messages: { author: "Name of Author required" quote: "Please enter Quote" }, errorPlacement: function(error, element) { error.appendTo( element.parent().top() ); } ); }); </script> <body> <div class="container"> <div class="center_div"> <h2>Submit Your Quote</h2> <fieldset> <form id="submitForm" action="qinsert.php" method="post"> <div class="error" style="display:none"></div> <div class="field"> <label>Author: </label> <input name="author" type="text" class="required" minLength=3> <span class="error"></span> </div><br /> <div class="field"> <label>Quote: </label> <textarea name="quote" cols=22 class="required" minLength=5></textarea> <span class="error"></span> <br /> </div> <input id="button1" type="submit" value="Submit" class="submit" /><br /> <input id="button2" type="reset" value="Reset" /> </form> </fieldset> </div> </div> what is wrong with the code? thank you!

    Read the article

  • jQuery Validation: Validating Checkboxes with Different Names

    - by Michael
    I have a set of 4 checkboxes, all with different names, and require that at least 1 is checked. I know there are a few posts on here already trying to answer this question. The solution that seems to be most logical to me is the answer posted on Question 1734840, but I can't seem to get it working! What's wrong with my code? Or any other new coding ideas to get this working? I have set the class on all of them to 'require-one'. My jQuery code is $(document).ready(function(){ $("#itemForm").validate({ highlight: function(element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); $(element.form).find("label[for=" + element.name + "]") .addClass("radioerror"); }, unhighlight: function(element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); $(element.form).find("label[for=" + element.name + "]") .removeClass("radioerror"); }, rules: { 'require-one': { required : { depends: function(element) { var allBoxes = $('.require-one'); if (allBoxes.filter(':checked').length == 0) { if (allBoxes.eq(element).length != 0) { return true; } } return false; } } } , }, errorPlacement: function(error, element) { if ( element.is("#other_descrip") ) error.appendTo("#othererror" ); if ( element.is("#itemlist") ) error.appendTo("#itemerror" ); } }); });

    Read the article

  • rails validation of presence not failing on nil

    - by holden
    I want to make sure an attibute exists, but it seems to still slip thru and I'm not sure how better to check for it. This should work, but doesn't. It's a attr_accessor and not a real attribute if that makes a difference. validates_presence_of :confirmed, :rooms {"commit"=>"Make Booking", "place_id"=>"the-kosmonaut", "authenticity_token"=>"Tkd9bfGqYFfYUv0n/Kqp6psXHjLU7CmX+D4UnCWMiMk=", "utf8"=>"✓", "booking"=>{"place_id"=>"6933", "bookdate"=>"2010-11-22", "rooms"=>[{}], "no_days"=>"2"}} Not sure why my form_for returns a blank hash in an array... <% form_for :booking, :url => place_bookings_path(@place) do |f| %> <%= f.hidden_field :bookdate, { :value => user_cart.getDate } %> <%= f.hidden_field :no_days, { :value => user_cart.getDays } %> <% for room in pricing_table(@place.rooms,@valid_dates) %> <%= select_tag("booking[rooms][][#{room.id}]", available_beds(room)) %> <% end %> <% end %>

    Read the article

  • Validating a single radio button is not working in available javascript validation script Part-2

    - by OM The Eternity
    Hi All I am available with the solution given by @Tomalak for MY QUESTION could you pls help me out with it as its giving me an error in firebug as : frm.creatorusers is undefined [Break On This Error] var rdo = (frm.creatorusers.length ...rm.creatorusers : frm.creatorusers; I used the code for validating radio button as: function valDistribution(frm) { var mycreator = -1; var rdo = (frm.creatorusers.length > 0) ? frm.creatorusers : frm.creatorusers; for (var i=0; i<rdo.length; i++) { if (rdo[i].checked) { mycreator = 1; //return true; } } if(mycreator == -1){ alert("You must select a Creator User!"); return false; } }

    Read the article

  • RESTful application validation. Mix of frontend/backend validation. How?

    - by Julian Davchev
    Hi. Using RESTful for all backend persistance and operations. I just pass data from frontend (by frontend I don't mean clientside but the part that is making use of the REST) to rest and data gets back success or no with validation errors if any. Thing is I have stuff that should be validated on frontend too..like csrf tokens, captcha etc. Only reasonable way is I mix validation coming from token/captcha checks and validation errors coming back from REST. Issue with this will be kinda automation as I wouldn't want form field names to map 1:1 with backend field names use by the REST documents. Any pointers ideas are more than welcome.

    Read the article

  • XML Rules Engine and Validation Tutorial with NIEM

    - by drrwebber
    Our new XML Validation Framework tutorial video is now available. See how to easily integrate code-free adaptive XML validation services into your web services using the Java CAMV validation engine. CAMV allows you to build fault tolerant content checking with XPath that optionally use SQL data lookups. This can provide warnings as well as error conditions to tailor your validation layer to exactly meet your business application needs. Also available is developing test suites using Apache ANT scripting of validations.  This allows a community to share sets of conformance checking test and tools . On the technical XML side the video introduces XPath validation rules and illustrates and the concepts of XML content and structure validation. CAM validation templates allow contextual parameter driven dynamic validation services to be implemented compared to using a static and brittle XSD schema approach.The SQL table lookup and code list validation are discussed and examples presented.Features are highlighted along with a demonstration of the interactive generation of actual live XML data from a SQL data store and then validation processing complete with errors and warnings detection.The presentation provides a primer for developing web service XML validation and integration into a SOA approach along with examples and resources. Also alignment with the NIEM IEPD process for interoperable information exchanges is discussed along with NIEM rules services.The CAMV engine is a high performance scalable Java component for rapidly implementing code-free validation services and methods. CAMV is a next generation WYSIWYG approach that builds from older Schematron coding based interpretative runtime tools and provides a simpler declarative metaphor for rules definition. See: http://www.youtube.com/user/TheCAMeditor

    Read the article

  • creating a Grails application in IntelliJ IDEA 9.0.x fails to prompt for "create-app"

    - by dave
    When I create a Grails application in IntelliJ 9 on Snow Leopard I am not prompted to create an application. IntelliJ finished the wizard and creates an empty project that is not a Grails application. I have tried two different Apple computers (MacBook Pro and Mac Pro) it does not work on either. The same steps on a Linux system results in a prompt to "create-app" and a Grails application. I have already tried the steps in http://stackoverflow.com/questions/470882/intellij-idea-setup-on-os-x Is there a specific place that Grails needs to be installed? Has anyone else seen this behavior? Thanks

    Read the article

  • Grails and Flex build process integration

    - by Dan
    I plan to use Grails and Flex in my next project. I would like to use grails command line to construct my project. This should include the flex part as well, compiling swf, executing FlexUnits etc. I would like to compile and add swf file to war when I do “grails war”. How can I accomplish this?

    Read the article

  • Grails 1.2.1 with Spring 3.0.0 dependency problem under Jetty

    - by archer
    Just moved to Grails 1.2.1 (used 1.1.1 before). Changed application.properties, ran grails upgrade, fixed BuildConfig and Bootstrap - everything works just fine from grails console. However, getting a problem when deploy packaged war under jetty 6.1.22: 1581 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NoSuchMethodError: org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.setParameterNameDiscoverer(Lorg/springframework/core/ParameterNameDiscoverer;)V My project is built with maven2. I researched the war dependencies and see that both spring 2.5.6 and 3.0.0.RELEASE are used there. I then tried to suppress use of spring 2.5.6 and got a problem with Acegi plugin (using version 0.5.1): 2010-03-10 21:06:56.440:WARN::Nested in org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V Any help would be greatly appreciated.

    Read the article

  • Using java classes in Grails

    - by RN
    I have a Java\Spring\Hibernate application - complete with domain classes which are basically Hibernate POJOs There is a piece of functionality that I think can be written well in Grails. I wish to reuse the domain classes that I have created in the main Java app What is the best way to do so ? Should I write new domain classes extending the Java classes ? this sounds tacky Or Can I 'generate' controllers off the Java domain classes ? What are the best practices around reusing Java domain objects in Grails\Groovy I am sure there must be others writing some pieces in grails\groovy If you know about a tutorial which talks about such an integration- that would be awesome !!! PS: I am quite a newbie in grails-groovy so may be missing the obvious. Thanks !!!

    Read the article

  • Grails UrlMappings with .html

    - by Glennn
    I'm developing a Grails web application (mainly as a learning exercise). I have previously written some standard Grails apps, but in this case I wanted to try creating a controller that would intercept all requests (including static html) of the form: <a href="/testApp/testJsp.jsp">test 1</a> <a href="/testApp/testGsp.gsp">test 2</a> <a href="/testApp/testHtm.htm">test 3</a> <a href="/testApp/testHtml.html">test 4</a> The intent is to do some simple business logic (auditing) each time a user clicks a link. I know I could do this using a Filter (or a range of other methods), however I thought this should work too and wanted to do this using a Grails framework. I set up the Grail UrlMappings.groovy file to map all URLs of that form (/$myPathParam?) to a single controller: class UrlMappings { static mappings = { "/$controller/$action?/$id?"{ constraints { } } "/$path?" (controller: 'auditRecord', action: 'showPage') "500"(view:'/error') } } In that controller (in the appropriate "showPage" action) I've been printing out the path information, for example: def showPage = { println "params.path = " + params.path ... render(view: resultingView) } The results of the println in the showPage action for each of my four links are testJsp.jsp testGsp.gsp testHtm.htm testHtml Why is the last one "testHtml", not "testHtml.html"? In a previous (Stack Overflow query) Olexandr encountered this issue and was advised to simply concatenate the value of request.format - which, indeed, does return "html". However request.format also returns "html" for all four links. I'm interested in gaining an understanding of what Grails is doing and why. Is there some way to configure Grails so the params.path variable in the controller shows "testHtml.html" rather than stripping off the "html" extension? It doesn't seem to remove the extension for any other file type (including .htm). Is there a good reason it's doing this? I know that it is a bit unusual to use a controller for static html, but still would like to understand what's going on.

    Read the article

  • How to make use of Grails Dependencies in your IDE

    - by raoulsson
    Hi All, So I finally got my dependencies working with Grails. Now, how can my IDE, eg IntelliJ or Eclipse, take advantage of it? Or do I really have to manually manage what classes my IDE knows about at "development time"? If the BuildConfig.groovy script is setup right (see here), you will be able to code away with vi or your favorite editor without any troubles, then run grails compile which will resolve and download the dependencies into the Ivy cache and off you go... If, however, you are using an IDE like Eclipse or IntelliJ, you will need the dependencies at hand while coding. Obviously - as these animals will need them for the "real time" error detection/compilation process. Now, while it is certainly possible to code with all the classes shining up in bright red all over the place that are unknown to your IDE, it is certainly not much fun... The Maven support or whatever it is officially called lives happily with the pom file, no extra "jar directory" pointers needed, at least in IntelliJ. I would like to be able to do the same with Grails dependencies. Currently I am defining them in the BuildConfig.groovy and additionally I copy/paste the current jars around on my local disk and let the IDE point to it. Not very satisfactory, as I am working in a highly volatile project module environment with respect to code change. And this situation ports me directly into "jar hell", as my "develop- and build-dependencies" easily get out of sync and I have to manage manually, that is, with my brain... And my brain should be busy with other stuff... Thanks! Raoul P.S: I'm currently using Grails 1.2M4 and IntelliJ 92.105. But feel free to add answers on future versions of Grails and different, future IDEs, as the come in...

    Read the article

  • Grails target folder doesn't appear to be on application's classpath

    - by Kobi
    I have a grails project with some additional java source files under src/java folder. When compiling/running the server, the files under that directory get compiled into the project's target folder, together with all other groovy/grails classes. So far so good. However, when I try to load one of the java source files (from src/java) using reflection (Class.forName to be exact), a ClassNotFoundException gets thrown. What is peculiar about the whole thing is that if I copy that same class from project's target/ folder into the following location (on windows): <myuser>\.grails\1.2.2\projects\<MyProjectName>\resources then no exception gets thrown and the corresponding class is loaded fine. This seems to indicate to me that the integrated grails server only looks at classes within the user's dynamically generated project folder, and not the actual project's target folder. Is my understanding correct? Is there a way to force grails to copy certain classfiles from target/ folder into the resources folder within the user dir? Is there a different way to load the classfiles using reflection? I was looking at using the grailsApplication's classloader but that didn't seem to work either. Any tips would be more than welcome. Thanks a lot in advance!

    Read the article

  • How do I extend the classpath used for 'grails run-app'

    - by Eric
    I have the following in my Config.groovy file: grails.config.locations = [ "classpath:env.groovy" ] Now, where exactly am I supposed to place "env.groovy" such that it is available on the CLASSPATH during grails run-app? The documentation here is sorely lacking. I am able to get it to work on the pure commandline by placing "env.groovy" in $APP_HOME/etc and then running: $ grails -classpath ./etc run-app This seems a little hackish, but I can live with it... However, I am unable to get any such configuration working when I launch run-app using the Grails eclipse plugin (STS): Unable to load specified config location classpath:env.groovy : class path resource [env.groovy] cannot be opened because it does not exist I've seen related posts here, here, here, and here but the answers have been unfulfilling. I am looking for a CLASSPATH-based solution that will work with 'run-app' in development mode (both commandline and from eclipse). I know how to set up the CLASSPATH for my deployment servlet container, so that is not an issue.

    Read the article

  • Grails external Jms broker (active mq)

    - by TheBigS
    I have what will become an 'external' activemq server I'd like grails to be able to talk to. Right now I am just running it on my dev box. Here is what I have setup right now: 1) Run activemq server 2) Run activemq/examples using ant to produce messages 3) View ActiveMQ admin site: http://localhost:8161/admin/queues.jsp verify that messages are in the queue. 4) Follow Mini Tutorial to create the Service and Controller: http://www.grails.org/ActiveMQ+Plugin 5) Configured my Grails resources.groovy file as follows: beans = { jmsConnectionFactory(SingleConnectionFactory){ targetConnectionFactory = { ActiveMQConnectionFactory cf -> brokerURL = 'tcp://localhost:61616' } } } When I run the grails app I get a BindException saying port 61616 is already in use. How do I configure this to use my server that is already running? I've tried changing 'localhost' to '127.0.0.1' and to my LAN ip, but no luck, it keeps trying to setup its own embedded activemq server. Any ideas?

    Read the article

  • Grails script dependency error

    - by Don
    Hi, I have a Grails (GAnt) script with the following target: includeTargets << grailsScript("_GrailsInit") includeTargets << grailsScript("_GrailsPlugins" target('default': "Does something awesome!") { depends(updatePluginsList) // Implementation omitted } Since upgrading to Grails 1.3.1, when I run this I get the error groovy.lang.MissingPropertyException: No such property: updatePluginsList for class: So it appears that the target updatePluginsList has disappeared. This target used to be provided by Grails, so I guess it's either been removed or renamed in a recent release? Thanks, Don

    Read the article

  • Grails spring security defaultTargetUrl going wrong path

    - by fsi
    Grails 2.4 with Spring security 2 3RC I have this on my Config.groovy grails.plugin.springsecurity.controllerAnnotations.staticRules = [ '/': ['permitAll'], '/index': ['permitAll'], '/index.gsp': ['permitAll'], '/**/js/**': ['permitAll'], '/**/css/**': ['permitAll'], '/**/images/**': ['permitAll'], '/**/favicon.ico': ['permitAll'] ] grails.plugin.springsecurity.successHandler.defaultTargetUrl = "/home/index" But this keeping me redirecting to assets/favicon.ico And my HomeController is like that @Secured(['ROLE_ADMIN', 'ROLE_USER']) def index() { if (SpringSecurityUtils.ifAllGranted('ROLE_ADMIN')) { redirect controller: 'admin', action: 'index' return } } And I modify this in my UrlMapping: "/"(controller: 'home', action:'index') Why it keeps me sending wrong path? Update: using another computer, it redirects me to /asset/grails_logo.png

    Read the article

  • Dapper and object validation/business rules enforcement

    - by Eugene
    This isn't really Dapper-specific, actually, as it relates to any XML-serializeable object.. but it came up when I was storing an object using Dapper. Anyways, say I have a user class. Normally, I'd do something like this: class User { public string SIN {get; private set;} public string DisplayName {get;set;} public User(string sin) { if (string.IsNullOrWhiteSpace(sin)) throw new ArgumentException("SIN must be specified"); this.SIN = sin; } } Since a SIN is required, I'd just create a constructor with a sin parameter, and make it read-only. However, with a Dapper (and probably any other ORM), I need to provide a parameterless constructor, and make all properties writeable. So now I have this: class User: IValidatableObject { public int Id { get; set; } public string SIN { get; set; } public string DisplayName { get; set; } public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) { // implementation } } This seems.. can't really pick the word, a bad smell? A) I'm allowing to change properties that should not be changed ever after an object has been created (SIN, userid) B) Now I have to implement IValidatableObject or something like that to test those properties before updating them to db. So how do you go about it ?

    Read the article

  • How to remove java.sql.BatchUpdateException in Grails? [closed]

    - by aman.nepid
    I have a domain like this: class BusinessOrganization { static hasMany = [organizationBusinessTypes:OrganizationBusinessType] String name String icon static constraints = { name(blank:false,unique:true) icon(unique:true) } String toString() { return "${name}" } } When I save some data for first time it works fine. But when by the next time it shows this error : Error 500: Internal Server Error URI /nLocatePortal/businessOrganization/save Class java.sql.BatchUpdateException Message Batch entry 0 insert into business_organization (version, icon, name, id) values ('0', '', 'dddd', '2') was aborted. Call getNextException to see the cause. **Around line 24 of grails-app/controllers/com/nlocate/portal/BusinessOrganizationController.groovy** 21: 22: def save() { 23: def businessOrganizationInstance = new BusinessOrganization(params) 24: if (!businessOrganizationInstance.save(flush: true)) { 25: render(view: "create", model: [businessOrganizationInstance: businessOrganizationInstance]) 26: return 27: } Please someone help me why this is happening. I am new to Grails. I have not modified the controllers but still I get this error.

    Read the article

  • Using Custom Validation with LINQ to SQL in an ASP.Net application

    - by nikolaosk
    A friend of mine is working in an ASP.Net application and using SQL Server as the backend. He also uses LINQ to SQL as his data access layer technology. I know that Entity framework is Microsoft's main data access technology. All the money and resources are available for the evolution of Entity Framework. If you want to read some interesting links regarding LINQ to SQL roadmap and future have a look at the following links. http://blogs.msdn.com/b/adonet/archive/2008/10/29/update-on-linq-to-sql-and...(read more)

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >