form-validation

ModelState.AddModelError encodes HTML

Hi I am noticing a weird issue when using ModelState.AddModelError to validate input on my forms. The output from Html.ValidationMessage is not the true HTML value but it's encoded value and so the CSS style is not applied to the error message. Example: private string errorMessage = "<span class=\"negative\">{0}</span><br class=\"hid\...

Intent of Spring form command

Spring's form controller (such as SimpleFormController or BaseCommandController) uses commands to pass data between the HTML form and controller. My question is, is it common practice to use the backing model as the command itself? Or is it common to create a separate command with correspond attributes to those in the backing model. My ...

Easiest Form validation library for PHP?

I need a simple php library which can be used to easily pass rules and field names to, and then validation could be easily performed. There should also be an easy way to retrieve the errors. Any suggestions? ...

disable some asp.net validation controls when a checkbox is checked

I'm using old fashioned ASP.NET validation (ugh) for a checkout process. I have a checkbox "I'll call with my credit card details". If checked I need to disable the required field validator and cc validator for the credit card number both on the client and on the postback. How do it do it? Thanks! ...

Keeping request parameters on Spring SimpleFormController with Validator

I hope I'll be able to explain this properly. I'm developing a portlet for Liferay by using Spring. It's a pinboard system. So I have a view (Jsp) which shows the detail of a certain pinboard entry, given its id. Furthermore there is a link which goes to an AddCommentController for adding a new comment to the pinboard entry the user is c...

Custom Zend Error message for checkboxes

I have a form in a Zend-based site which has a required "Terms and Conditions" checkbox. I have set a custom message which says "you must agree with terms and conditions". however, because the checkbox is "presence='required'", it returns Field 'terms' is required by rule 'terms', but the field is missing which is this constant de...

jQuery validation

Hi. I have a form <form action="/Account/Create" id="account" method="post"> <fieldset> <legend>Fields</legend> <p> <label for="Password">Password:</label> <input id="Password" name="Password" type="text" value="" /> </p> <p> <label for="OpenID">OpenID:</labe...

ModelMultipleChoiceField validation acting differently depending on widget

I have a form with a ModelMultipleChoiceField and it works like a charm. However, when I set widget=forms.RadioSelect the form validation always fails with the error message "Enter a list of values." As I said, it works perfectly well with the default widget, but not with the radio select widget. The POST request to validate the form ...

Date validation through javascript

Hello guys, Please help me to solve my problem. I am stuck with a problem in javascript. My problem is that i have to use date validation. I have two date fields and i am putting the validation on both, but the problem is that it is working on one datefield and not in the other one. Like: code of javascript function ValidateDate(DateFr...

Preventing web site links and email addresses in a form when "Submit" is pressed

Folks, I have an html form which sends the form data as an email. Unfortunately spam bots have been filling the form in and send web site links and email addresses in the message part of the form. Is there a way I can delete the web site links and email addresses when the "Submit" button is pressed before it gets sent on as an email ad...

JQuery Require Checkbox and Radio Button before submit

I am having one heck of a hard time trying to figure this out. Been looking at examples and tools for JQuery validation for over 3 hours now. All I want to do is require that a checkbox is selected and a radio button, but I don't care which one is required. <form id="form1" action="/controller/action" method="post"> <div cl...

XML Form validation?

Is there a simple form validation that runs off of an XML file that controls the generation of HTML, Javascript, and PHP would actually follow the rules too? The way its done now i have to split the two up. ...

How do I validate a nodereference field in a custom node form in Drupal 6?

I have an autocomplete nodereference field (field_hostnamelastref) in a custom pass-node-form.tpl.php. The field references four items (last name, first name, an id #, and status) generated from tokens in an autotitle from another content type. When entering a last name in the nodereference field, if the corresponding status for that l...

Multi-state Validation in Rails

I'm working on a Rails app that existing users can invite additional members to join. The problem with this is that the User model exists in different states and in those different states, different sets of information is required. For example, John is a member of the site and invites Mary. John enters Mary's name and email address, a...

Validator - Show one error at a time

Is there a simples way to do this? I have 2 TextBox, for email input, with regex and compare validator. If user input invalid email and a different email at second textbox, is shown two error messages. But i want to display just one error message at a time. ...

jQuery validation errorPlacement and removing elements?

Ok, I've tried a few things, but I'm stuck here... Here's the HTML I'm working with: <div class="required"> <label for="paysys_idworldpay" class="labelRadio"> <input type="radio" value="worldpay" name="paysys_id" id="paysys_idworldpay" class="inputRadio"/> <b>WorldPay</b></label> <label for="paysys_idoffline" class="labelRadio"> <input...

What is the event to catch form submission in Javascript?

A couple of questions here: I was wondering what event do I use to execute some javascript on form submission (to do some validation)? Once I have done my validation, how do I then submit the form in javascript ? Cheers... ...

Grabbing POST variable in form clean() method

Is there a straightforward way to access a POST variable to complete some custom validation lookups in a admin form field's clean method? def clean_order_price(self): if not self.cleaned_data['order_price']: try: existing_price = ProductCostPrice.objects.get(supplier=supplier, product_id=self.cleaned_data['product'], is_late...

JQuery Validation Help

Hi, I need help validating a form, preferably using JQuery: this is my code: <form action='index.php' method='post'> <table> <tr> <td>1.</td> <td><select name='from_1'><option>HOME</option><option>A</option><option>B</option><option>C</option></select></td> <td><select name='to_1'><option>HOME</option><option>A</option><opti...

How can I do form validation with jQuery using icons as pass/fail indicators?

How can I do form validation with jQuery to allow a green check mark if a field passes a regex and a red x if it fails? Can anyone point me to an example of some jQuery that shows one icon immediately if a field validates and a different one if it fails? ...