Search Results

Search found 18876 results on 756 pages for 'request validation'.

Page 15/756 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • how to prevent white spaces in a regular expression regex validation

    - by Rees
    i am completely new to regular expressions and am trying to create a regular expression in flex for a validation. using a regular expression, i am going to validate that the user input does NOT contain any white-space and consists of only characters and digits... starting with digit. so far i have: expression="[A-Za-z][A-Za-z0-9]*" this correctly checks for user input to start with a character followed by a possible digit, but this does not check if there is white space...(in my tests if user input has a space this input will pass through validation - this is not desired) can someone tell me how i can modify this expression to ensure that user input with whitespace is flagged as invalid?

    Read the article

  • PHP form validation question?

    - by GeNx
    I have a form that validates the email address and I want to be able to place echo '<p class="error">Please enter a valid email address!</p>'; anywhere on the web page without having to put the validation process within the html? Or should I include the validation process in the HTML form? Here is the php code. if (preg_match ('/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,6}$/', $_POST['email'])) { $email = mysqli_real_escape_string($mysqli, strip_tags($_POST['email'])); } else { echo '<p class="error">Please enter a valid email address!</p>'; }

    Read the article

  • Suspend file validation on Zend Framework

    - by dimitris mistriotis
    Hi, Currently on my application I have a form where I ask the user to upload an image file to be used as a logo. I want to allow the user to reset that to nothing by supplying no file (by just pressing the upload button from the browser). In this scenario the only thing left is to suspend file validation when no file is included. Currently I get the *self::NO_FILE* error from the *Zend_Validate_File_Upload* class. Is there any way to suspend the validation so that nothing will be checked if no file has been provided?

    Read the article

  • Dynamic data validation in ASP.NET MVC

    - by user252160
    I've recently read about the model validation capabilities of ASP.NET MVC which are all very cool until a certain point. What happens if the application doesn't know the data that it works with because it is all stored in DB and built together at runtime. Just like in Drupal, I'd like to be able to define custom types at runtime, and assign runtime validation rules as well. Obviously, the idea of assigning attributes to well established models is now gone. What else could be done ? I am thinking in terms of rules being stored as JSON objects in the DB fields or something like that.

    Read the article

  • jquery form validation

    - by kalpaitch
    I am using jquery for a quick and easy form validation My forms use the input's default value as a label and I have a little onfocus and onblur javascript function to show and hide this when the user starts to type: <input name='fnameREG' type='text' id='fnameREG' value='first name' size='70' onfocus='clearInput(this)' onblur='clearInput(this)' /> <input name='lnameREG' type='text' id='lnameREG' value='last name' size='70' onfocus='clearInput(this)' onblur='clearInput(this)' /> My issue with the validation is that when the submit button is clicked the pluggin thinks that all the fields are set because they have a default value. I looked but I couldn't find a supplied method to get round this. Thanks!

    Read the article

  • Good input validation loop using cin - C++

    - by Alex
    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; // input validation loop do { error = 0; cout << "Please enter in your taxable income: "; cin >> taxableIncome; if (cin.fail()) { cout << "Please enter a valid integer" << endl; error = 1; cin.clear(); cin.ignore(80, '\n'); } }while(error == 1);

    Read the article

  • Is it possible to group validation?

    - by lambdabutz
    I am using a lot of my own validation methods to compare the data from one association to the other. I've noticed that I'm constantly checking that my associations aren't nil before trying to call anything on them, but I am also validating their presence, and so I feel that my nil checks are redundant. Here's an example: class House < ActiveRecord::Base has_one :enterance, :class => Door has_one :exit, :class => Door validates_presence_of :enterance, :exit validate :not_a_fire_hazard def not_a_fire_hazard if enterance && exit && enterance.location != exit.location errors.add_to_base('If there is a fire you will most likely die') return false end end end I feel like I am repeating myself by checking the existence of enterance and exit within my own validation. Is there a more "The Rails Way" to do this?

    Read the article

  • Server-side validation and form action

    - by phenry
    I have a page (call it form.php) with a form for users to fill out. When the form is submitted, I want to validate it with a server-side script (call it validate.php if necessary, although the code could also go in one of the other pages if that would be better). If any part of the form fails validation, I want to kick back to form.php with the fields the user needs to fix highlighted. If the form passes validation, I want to go to another page, success.php. Which page should I put in the "action" attribute of the <form> element, and what's the best way to get from that page to one of the others?

    Read the article

  • ASP.Net MVC Ajax form with jQuery validation

    - by Tomas Lycken
    I have an MVC view with a form built with the Ajax.BeginForm() helper method, and I'm trying to validate user input with the jQuery Validation plugin. I get the plugin to highlight the inputs with invalid input data, but despite the invalid input the form is posted to the server. How do I stop this, and make sure that the data is only posted when the form validates? My code The form: <fieldset> <legend>leave a message</legend> <% using (Ajax.BeginForm("Post", new AjaxOptions { UpdateTargetId = "GBPostList", InsertionMode = InsertionMode.InsertBefore, OnSuccess = "getGbPostSuccess", OnFailure = "showFaliure" })) { %> <div class="column" style="width: 230px;"> <p> <label for="Post.Header"> Rubrik</label> <%= Html.TextBox("Post.Header", null, new { @style = "width: 200px;", @class="text required" }) %></p> <p> <label for="Post.Post"> Meddelande</label> <%= Html.TextArea("Post.Post", new { @style = "width: 230px; height: 120px;" }) %></p> </div> <p> <input type="submit" value="OK!" /></p> </fieldset> The JavaScript validation: $(document).ready(function() { // for highlight var elements = $("input[type!='submit'], textarea, select"); elements.focus(function() { $(this).parents('p').addClass('highlight'); }); elements.blur(function() { $(this).parents('p').removeClass('highlight'); }); // for validation $("form").validate(); }); EDIT: As I was getting downvotes for publishing follow-up problems and their solutions in answers, here is also the working validate method... function ajaxValidate() { return $('form').validate({ rules: { "Post.Header": { required: true }, "Post.Post": { required: true, minlength: 3 } }, messages: { "Post.Header": "Please enter a header", "Post.Post": { required: "Please enter a message", minlength: "Your message must be 3 characters long" } } }).form(); }

    Read the article

  • Validation errors from Google App Engine Logout link

    - by goggin13
    I am making a web page using the Google App Engine. I am validating my pages, and found that the logout link that is generated by the call to the users api (in python) users.create_logout_url(request.uri) does not validate as XHTML 1.0 Strict. The href in the anchor tag looks like this: /_ah/login?continue=http%3A//localhost%3A8080/&action=Logout Including a link with this anchor text throws three different validation errors: *general entity "action" not defined and no default entity *reference to entity "action" for which no system identifier could be generated *EntityRef: expecting ';' Here is a dummy page with the anchor tag in it, if you want to try it on w3c validator.Dummy Page. The logout link wont work, but you can see how the page is valid without it, but the actual text inside the href tag breaks the validation. Any thoughts on whats going on? Thank you!

    Read the article

  • ASP.NET client side validation with dataannotations - javascript minimumlength zero

    - by Kordonme
    Hi! I'm doing client side validation on a project I'm working on. Everything works, except for the minimumlength property of the StringLength attribute (it works when submitting and a serverside validation is done): [StringLength(50, MinimumLength = 6)] The javascript generated by Html.EnableClientValication(); is the following: // snip {"FieldName":"User.Password","ReplaceValidationMessageContents":true,"ValidationMessageId":"User_Password_validationMessage","ValidationRules":[{"ErrorMessage":"The field Password must be a string with a minimum length of 6 and a maximum length of 50.","ValidationParameters":{"minimumLength":0,"maximumLength":50},"ValidationType":"stringLength"}]}],"FormId":"form0","ReplaceValidationSummary":false}) The important thing is here: {"minimumLength":0,"maximumLength":50} It produces javascript with the wrong minimumproperty. You guys have a hint? Is this a possible bug?

    Read the article

  • immediate=true is set on a jsf command button but still seeing validation

    - by Zack Macomber
    I have the following command button set up in a facelet: <h:commandButton action="#{addressAction.deletePreviousAddress}" value="#{bundle['button.deleteAddress']}" styleClass="deg-form-button" immediate="true"> <f:setPropertyActionListener target="#{addressAction.addressActionForm.previousAddress}" value="#{address}"> </f:setPropertyActionListener> </h:commandButton> In AddressAction, the following code gets run to delete a previous address on the form: public Enum<NavigationConstants> deletePreviousAddress() { addressActionForm.getPreviousAddresses().remove(addressActionForm.getPreviousAddress()); return NavigationConstants.addresses; } Before I made the address input components "required=true", this code worked fine and removed the previous address from the jsf form successfully. Right now, I can't successfully delete a previous address because validation is occurring and stating that the input components need to be filled in on the previous address record on the form. How can I bypass this validation? I thought the "immediate=true" attribute on the command button would have accomplished it but that's not cutting it in my case...

    Read the article

  • JQuery Validation - Wrap offending field in a div.

    - by Samuurai
    Hi, It's my first time using StackOverFlow and first time trying to set up jQuery Validation. It's displaying <label> tags with the error messages as default behaviour, however the way my CSS is set up I need a div to wrap around the offending element and a message display in <p> tags. Without errors, my html looks like this: <div class="grid-26 append-2"> <p class="noMarginBottom"> <label>First Name</label> <div class="jNiceInputWrapper"> <div class="jNiceInputInner"> <input type="text" class="text jNiceInput" name="name"/> </div> </div> </p> <span class="clear"/> </div> And with Errors, it needs to look like this - Note the div with class "error" and the <p> tag. <div class="grid-26 append-2"> <div class="error"> <p>Please write your real name</p> <p class="noMarginBottom"> <label>First Name</label> <div class="jNiceInputWrapper"> <div class="jNiceInputInner"> <input type="text" class="text jNiceInput" name="name"/> </div> </div> </p> <span class="clear"/> </div> </div> My Validation code is very basic. $(document).ready(function(){ $("#contact_form").validate({ rules:{ name: { required: true } } }); }); This is my first venture into jQuery and form validation, so I'll be the first to say "I'm lost!" any help would be greatly appreciated. Thanks.

    Read the article

  • CodeIgniter Validation in Library does not accept callback.

    - by Lukas Oppermann
    Hey guys, my problem is the following: I am writing a login library. This library has a function _validation() and this uses the validation library to validate the data. With using normal validation methods it works just fine, but using a callback function just does not work. It is not called. I call it like this. $this->CI->form_validation->set_rules('user', 'Username', 'required|callback__check_user'); The functions name is _check_user and it uses the username _check_user($user). The function itself works fine and I can also call it in the class ($this-_check_user('username')) with a working result. I am guessing, there might be a problem because I am not workin in a controller so I have a CI instance $this-CI instead of just the original instance $this- Does anyone have a clue how to fix this? Thanks in advance.

    Read the article

  • JQuery Validation Plugin not working when used on page that includes another page via AJAX

    - by droidy
    We have a long page that contains a bunch of different form elements. One part of the form is called remotely via AJAX and is populated in an empty div. This is the part which JQuery Validation plugin is not working correctly on. We have class="required" on the elements on this page, but they do not show up as required. I'm guessing it's because the Validation plugin is looking for class="required" on our main page, and since the content from the AJAX page is put into the empty div behind the scenes, it's not detected the required fields. Any help is greatly appreciated.

    Read the article

  • WFP Validation & IDataErrorInfo

    - by Jefim
    A note - the classes I have are EntityObject classes! I have the following class: public class Foo { public Bar Bar { get; set; } } public class Bar : IDataErrorInfo { public string Name { get; set; } #region IDataErrorInfo Members string IDataErrorInfo.Error { get { return null; } } string IDataErrorInfo.this[string columnName] { get { if (columnName == "Name") { return "Hello error!"; } Console.WriteLine("Validate: " + columnName); return null; } } #endregion } XAML goes as follows: <StackPanel Orientation="Horizontal" DataContext="{Binding Foo.Bar}"> <TextBox Text="{Binding Path=Name, ValidatesOnDataErrors=true}"/> </StackPanel> I put a breakpoint and a Console.Writeline on the validation there - I get no breaks. The validation is not executed. Can anybody just press me against the place where my error lies?

    Read the article

  • How can i make a callback to accordion after form validation, to show errors

    - by Esger
    I have a very long form, which is divided into fieldsets which in turn are being shown or hidden, using the harmonica from jQuery UI. I am using form validation from jQuery as well, all newest versions. After submission and validation the user is redirected to the first erroneous field by $('myForm').validate(); But the containing harmonica fieldset has to be showed/opened with $('myForm').accordion('activate', index); as well, in order to show the field to the user. So how can I open the appropriate accordion fieldset after the form has been tried to submit? Is there a way to do it in a callback function after $('myForm').validate();

    Read the article

  • CodeMirror Dynamic Syntax Validation

    - by rawr
    Been trying to decide between using CodeMirror or Ace editor. I've been leaning towards CodeMirror, however there's one feature of Ace that I really like and that is how it does syntax validation. So as I'm typing there can appear a warning or error icon in the left gutter area beside the line number, and when I hover over it it gives me a little description. Is there any way to get this functionality in CodeMirror? Specifically, I'm using the css mode for CodeMirror. It'd also be nice to be able to add in my own custom validation. Thanks.

    Read the article

  • Using different validation rules based on user input.

    - by chiefanov
    I have a simple form: a combobox and a textbox. My combobox has 2 values: A and B. When value A is selected I want textbox to use a validation rule. When value B is selected there should be no validation rules applied to the textbox. I've read an article that has a solution and I'm trying to use it, but had no luck so far, and I think there might be a more elegant solution. Has anyone done anything like this before? Any ideas are highly appreciated.

    Read the article

  • HTTP Module in detail

    - by Jalpesh P. Vadgama
    I know this post may sound like very beginner level. But I have already posted two topics regarding HTTP Handler and HTTP module and this will explain how http module works in the system. I have already posted What is the difference between HttpModule and HTTPHandler here. Same way I have posted about an HTTP Handler example here as people are still confused with it. In this post I am going to explain about HTTP Module in detail. What is HTTP Module As we all know that when ASP.NET Runtimes receives any request it will execute a series of HTTP Pipeline extensible objects. HTTP Module and HTTP handler play important role in extending this HTTP Pipelines. HTTP Module are classes that will pre and post process request as they pass into HTTP Pipelines.  So It’s one kind of filter we can say which will do some procession on begin request and end request. If we have to create HTTP Module we have to implement System.Web.IHttpModule interface in our custom class. An IHTTP Module contains two method dispose where you can write your clean up code and another is Init where your can write your custom code to handle request. Here you can your event handler that will execute at the time of begin request and end request. Let’s create an HTTP Module which will just print text in browser with every request. Here is the code for that. using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Experiment { public class MyHttpModule:IHttpModule { public void Dispose() { //add clean up code here if required } public void Init(HttpApplication context) { context.BeginRequest+=new EventHandler(context_BeginRequest); context.EndRequest+=new EventHandler(context_EndRequest); } public void context_BeginRequest(object o, EventArgs args) { HttpApplication app = (HttpApplication)o; if (app != null) { app.Response.Write("<h1>Begin Request Executed</h1>"); } } public void context_EndRequest(object o, EventArgs args) { HttpApplication app = (HttpApplication)o; if (app != null) { app.Response.Write("<h1>End Request Executed</h1>"); } } } } Here in above code you can see that I have created two event handler context_Beginrequest and context_EndRequest which will execute at begin request and end request when request are processed. In this event handler I have just written a code to print text on browser. Now In order enable this HTTP Module in HTTP pipeline we have to put a settings in web.config  HTTPModules section to tell which HTTPModule is enabled. Below is code for HTTPModule. <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <httpModules> <add name="MyHttpModule" type="Experiment.MyHttpModule,Experiment"/> </httpModules> </system.web> </configuration> Now I just have created a sample webform with following code in HTML like following. <form id="form1" runat="server"> <B>test of HTTP Module</B> </form> Now let’s run this web form in browser and you can see here it the output as expected.   Technorati Tags: HTTPModule,ASP.NET,Request

    Read the article

  • Is it possible to manipulate a request before IIS assigns that request to a specific site?

    - by Deane
    Is it possible to manipulate an inbound request at the IIS level, before it even gets assigned to site on the server? Essentially, I want to rewrite this -- www.somegenericdomain.com?site=someotherdomain To this -- www.someotherdomain.com And I need to do this before IIS picks which site the request belongs to, so I need to change the host header prior to this point. Possible, or crazy? We're running IIS7.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >