validate

Persisting a valid Geometry shape into Sql Server 2008 Geography column

I am using Spatial.NHibernate to save some geometry shapes to a Geography column in Sql Server 2008. Here is my mapping: public class AreaMapping : ClassMap<Area> { public AreaMapping() { Id(c => c.Id).GeneratedBy.HiLo(100.ToString()); Map(c => c.Name).Not.Nullable(); Map(x => x.Boundary) .Cus...

jquery validate before serialize

I'm trying to verify that certain fields in my form are numeric and not text. Where would I start ? If the fields are numeric, then serialize, if not then send an empty string. The reason I want to do this is because PHP sees the data for each variable as a string and not numeric. this is my ajax request $.ajax({ type: "POST...

Java InputReader. Detect if file being read is binary?

I had posted a question in regards to this code. I found that JTextArea does not support the binary type data that is loaded. So my new question is how can I go about detecting the 'bad' file and canceling the file I/O and telling the user that they need to select a new file? class Open extends SwingWorker<Void, String> { File fil...

Javascript Array in Class = How to make it valid

I am using this jQuery validation library on my website. It requires me to put the validation rules in the class part of the input tag. ie <input class="validate[required,custom[onlyLetter],length[0,100]]" name="firstname" type="text" /> Now this causes me to end up with code in mine that looks similar such as: <input type="text" ...

jquery validation field is not clearing error after blur or submit

I've fixed this issue before (inadvertently) and I'm coming across this again. Hopefully someone will be able to help me. I have a form using jquery's validation plugin (bassisstance.de). The form validation is working fine except for one issue. When qualifying a field after it's been classed as "error" the field class doesn't clear....

Only Allow Video Embed Codes (Rails)

I was wondering if anyone knew of a way to only allow embed codes like ones from youtube, vimeo, blip.tv, etc. into a form field? I have a form on my site that allow users to embed a video but I only want them to add the embed code html and nothing else dangerous like JS or additional html. Is there any tool out there that can do this or...

Jquery Validation Plugin Method required( dependency-expression ) use ok but callback not working

Hi all, i'm trying to make this work; this validate is applied to a payment form, and as you can see, there are only 3 requierd inputs, if and only if input[type=radio]:checked').val() != "CB"; wich means if user is about to pay with something else than a credit card. Following is the complete code to validate my form. $("#paiement"...

Drupal: Validate File Extension?

I'm trying to validate that an uploaded file really does have the .csv extension. This code isn't working, however: function upload_validate($form, &$form_state) { // code that does work ... else { $file = file_save_upload('upload'); $errors = file_validate_extensions($file, 'csv'); if (! empty($errors)) { form_set_err...

How to check if a Unix .tar.gz file is a valid file without uncompressing?

I also found this link. But I was wondering if there is any ready made command line solution? ...

revalidating a dependent field with jQuery .validate

I'm using the JQuery validate plug-in to validate my form. I have 4 fields that are related: ev_start, ev_end, ev_starttime and ev_endtime. The first two are dates, are required, and ev_end must be after ev_start. The second two are times and may or may not be required, but ev_endtime must be after ev_starttime if they are entered. If...

Acegi User Class constraints under groovy

Hi I have an Groovy appilcation using Acegi Spring Security. My User Class looks as follows: class User { static constraint = { email(blank:true, nullable:true) description(blank:false, nullable:false) username(blank: false, unique: true) userRealName(blank: false) company(nullable:true, blank:true) authorit...

Pylons FormEncode @validate decorator pass parameters into re-render action

I am attempting to use the validate decorator in Pylons with FormEncode and I have encountered an issue. I am attempting to validate a form on a controller action that requires parameters, and if the validation fails, the parameters aren't passed back in when the form is re-rendered. Here's an example. def question_set(self, id): ...

How to determine the dimensions of the icons in an icon object in .net, winforms?

I was wondering whether it's possible to validate a required size for an icon before trying: Dim myIcon = New Icon(theIcon, requestedSize). This falls over for negative numbers, so that's an easy check. It appears it falls over if the number is less than half of the smallest icon. I've looked at the icon class but can see nothing for...

Validate date format in php

I'm trying to validate date using PHP. I'd like following formats to be valid: d/m/yy d/m/yyyy dd/m/yy dd/m/yyyy d/mm/yy d/mm/yyyy dd/mm/yy dd/mm/yyyy I've tried many regular expressions and different variations of checkdate() function. Currently I have something like this: function _date_is_valid($str) { if(strlen($str) == 0) ...

Replace & to &amp; in URLs

I have TONS of XML Parsing Error: EntityRef: expecting ';' errors on my page only because of the incorrect use ampersands in links by the developer. Instead of asking him to use &amp; instead of &, how can I replace those after page load using jQuery? Edit: Ah right, validators read the source so it won't work. Is there any other way ...

JQuery Validate Plugin: make input required depending on radio button value

Hi all, I'm having a real headache trying to get the jQuery Validate plugin to work. I have a form, the first question asking the user to select an option from a radio group. This shows further questions below, depending on their selection. What I'm trying to achieve is making the visible questions required, but obviously depending o...

jQuery Validation doesn't highlight my select field on error *solved

Hey everyone, I am trying to apply a drop down validation (so if the value is equal to 0 of a <select><option value="0">) then it applies a background-color of yellow as it does for the rest of my input fields. Here is my code: <script src="jq.js"></script> <script src="validate.js"></script> <script> jQuery.validator.addMethod( "sel...

Validating a user using the FriendFeed API & posting an entry.

Given the username & remotekey for a user, how do i validate the user using the FriendFeed API in xcode? How do i pass the username & remotekey, if at all. ...

How do I validate an installer metapackage?

Is there a straightforward way to validate a metapackage's structure (recursively) against its info.plist? I have some code that patches a metapackage and I'd like to verify that it's left it in a correct state. Thanks! ...

how to validate zend form with jquery?

hi all how i could validate zend framework forms with jquery? any idea ? ...