input-validation

String Dot String (Mail without Domain) RegEx

Hi mates, Really got stuck on this simple regex. Need it to validate a string, that will be a mail without the "@domain.xxx". It must accomplish the following rules: there must be a string (only letters) starting. there must be a string (only letters) ending. this two strings must be separated by a dot. the complete string mustn't co...

asp.net validation controls - CSS placement

I am creating an address control which would use some address validation APIs( google/bing etc) to validate the user entered address. I would also like to validate the fields in the client side (like required fields, Zip format etc) with asp.net validation controls. I am trying to build this with CSS and am using float to align the text...

Validating User Input? C#

Hi, in an assignment, I have designed a input validation loop in C#, and I would like it to be able to check for the correct input format. I'm not for sure, but I think my designed loop is not checking the type of input, just what char is entered. I know I could use a try-catch block, but shouldn't you only use exceptions for exceptio...

PHP Filtering Form Input

Hey All, I'm sure someone has covered this before, but I didn't find it in a quick search of the site. Right now I'm trying to filter some input from a WYSIWYG, so that it will remove characters like: ¢©÷µ·¶±€£®§™¥ but keep HTML characters. I've tried htmlentities and htmlspecialcharacters, but that still seems to leave those characters...

iPhone: Save with validation on back navigation

In my iPhone application I have navigation controller, main screen and some edit screens. On edit screen user does some input that has to be validated before I can save it. Ideally I would like to update data automatically on back navigation without additional "Done" button. Can I do some validation and save on back navigation (i.e. when...

How to get old Value with onchange() event in text box

I have a text Box and a Value poplulated in it when page loads. Now If user chanegs any thing in text box, then I want to get the Changed Value(New Value) and Old Value but when I do ELEMENT.value then its giving only changed Value any Suggestions to get old value? below is my code <head> <script type="text/javascript"> fun...

Convert a string to int (But only if really is an int)

In college I was asked if our program detects if the string enter from command line arguments is a integer which it did not(./Program 3.7). Now I am wondering how I can detect this. So input as for example a is invalid which atoi detects, but input like for example 3.6 should be invalid but atoi will convert this to an integer. #includ...

Problem using rangelength for jQuery validation

Hi, I'm using the jQuery Validator Plugin. My code is like this: <input name="username" type="text" class="newtextbox required" rangelength="(4,16)"> The error message is "Please enter a value between NaN and 4 characters long". The actual error message that has to be is "Please enter a value between 4 and 16 characters long". I thi...

Is it possible to have Client-side Validation WITHOUT Javascript

Hi all, simple question really (can hazard a guess but just need to make sure), Just need a Yes/No answer as can't seem to claify anywhere. Reason? Web pages for phones, where javascript support is "sketchy" among all mobile browsers, so doing away with anything javascript altogether and was wondering if there are any alternatives. (A...

ASP.NET MVC check form input is valid on submit

Hi all, I have a form that, when submitted, shows a busy animation and disables the submit button. Anyone know how to query Microsoft's Sys.Mvc.FormValidation to see if the form passed its test so I can prevent the busy animation showing if the form hasn't actually been submitted? Is there some other work-around? At present my client ...

Alternative to ValidateInput("false") when passing HTML to a controller

I have a pretty simple ASP.NET MVC page and am using TinyMCE to allow users to enter comments. However, when I pass the data to a controller I receive the following error message: A potentially dangerous Request.Form value was detected from the client The consensus is that ValidateInput("false") should be set on the Action method...

Good input validation loop using cin - C++

Hi there, I'm in my second OOP class, and my first class was taught in C#, so I'm new to C++ and currently I am practicing input validation using cin. So here's my question: Is this loop I constructed a pretty good way of validating input? Or is there a more common/accepted way of doing it? Thanks! Code: int taxableIncome; int error...

Trying to validate an array of textfields using jQuery

I am trying to validate the following form using jQuery plugin but not successful yet. Please help me with the issue. <ol> <li> <label for="address1" class="biz">Address 1<span class="required">*</span></label> <input id="address1" name="address[address1]" class="text" type="text" > </li> ...

What Is a Good Layout for a Standard Error Log File?

I am trying to design the error and warning log file for my desktop program. As my program reads the user's input file, it may find syntax errors or invalid data of some sort. Once everything is read and the program is processing the data, more problems may be found. I want to write messages about these into a simple text file. I may...

Zend framework: what is the right place to validate user input?

I want to add a user in users table via link like '/index/adduser/id/7' . Question Should I validate user input inside 'adduserAction' function inside controller or somewhere inside model file? I've put files containing database related functions inside 'models' directory. Suppose a user is added to a table via 'id'. This id is sent vi...

Showing error in CodeIgniter Form Validation Class only if certain condition meet

First, i would to apologize for my bad english. Suppose i have function in controller like this : function confirm() { $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|exist[member.email]'); ...

Textbox validation in MVC2

I have added Required attribute to one of my properties of Model class as follows - [Required(ErrorMessage="UserID should not be blank")] [DisplayName("User Name")] public string UserName { get; set; } Inside my view, which inherits the class containing above property, I have tried to apply validaton to a textbox as follows - <%= Ht...

Cake PHP - Form Validiation doesn't work

Hi everybody, my CakePHP (1.2.5.) doesn't validate my form correct. $this->UserData->save($this->data); gives me always a true value back. I can't find the problem. The label for UserData.nichname works. That's the View: <?php echo $form->create('UserData'); echo $form->error('UserData.nick_name'); echo $form->input('UserData.nic...

RangeValidator Problem in ASP.NET

I was using RangeValidator to validate user input on client side for double values. One of my user said that when he enters 5E-10, my range validator does not understand that number as a valid double. What do you suggest me to do? Thanks, cas ...

How to get the same value as the user is seeing from a JFormattedTextField?

I'm using a NumberFormatter and JFormattedTextField, but the .getValue() doesn't return the same value as the user is seeing. I think the input-string is parsed using NumberFormats parse-method, and I get the Numberformat from NumberFormat.getNumberInstance(); with the actual Locale. So I don't think I easily can extend it and write my ...