Search Results

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

Page 9/756 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • JQuery username validation - Ajax call

    - by Denise
    Hi, I am currently using JQuery's validation plugin for basic form validation such as required fields. I want to add functionality so that when the user types in the username field, an ajax call is triggered to check whether the username is already taken. My requirements are: Preferably integrate with JQuery Validation plugin, rather than writing a custom function I want the lookup to occur on the nkeyup event I want the lookup to be triggered approx 0.5 seconds after the keyup event has occurred. Thanks!

    Read the article

  • PHP Form Validation

    - by JM4
    This question will undoubtedly be difficult to answer and ask in a way that makes sense but I'll try my best: I have a form which uses PHP to display certain sections of the form such as: <?php if ($_SESSION['EnrType'] == "Individual") { display only form information for individual enrollment } ?> and <?php if ($_SESSION['Num_Enrs'] > 6) { display only form information for 7 total members enrollment } ?> In each form piece, unique information is collected about each enrollee but the basic criteria for each enrollee is the same, i.e. All enrollee's must use have a value in the FirstName field. Each field is named according to the enrollee number, i.e. Num1FirstName; Num2FirstName. I have a PHP validation script which is absolutely fantastic and am not looking to change it but the issue I am running into is duplication of the script in order to validate ALL fields in one swoop. On submission, all POSTED items are run through my validation script and based on the rules set return an error if they do not equal true. Sample code: if (isset($_POST['submit'])) { // import the validation library require("validation.php"); $rules = array(); // stores the validation rules //All Enrollee Rules $rules[] = "required,Num1FirstName,Num2FirstName,The First Name field is required."; The script above does the following, $rules[] ="REQUIREMENT,fieldname,error message" where requirement gives criteria (in this case, simply that a value is passed), fieldname is the name of the field being validated, and error message returns the error used. My Goal is to use the same formula above and have $rules[] run through ALL firstnames and return the error posted ONLY if they exist (i.e. dont check for member #7's first name if it doesnt exist on the screen). If I simply put a comma between the 'fieldnames' this only checks for the first, then second, and so on so this wont work. Any ideas?

    Read the article

  • jQuery Validation 1.10 and MVC server-side errors

    - by sam360
    This feature used to work just fine on my website. If I added a custom error to ModelState, the input on the page would be marked as "input-validation-error" and the Html.ValidationMessage() would take care of rendering a span with the error message inside it. Due to incompatibility reasons we had to upgrade our jQuery Validation to 1.10: Now when I add a custom error to ModelState, I can debug and see that the HTML elements being rendered correctly, but as soon as the page load is completed, jQuery Validation removes the error message and set the "class" attribute of the input to "valid"! Has any one else come across this issue? UPDATE Testing further shows that the error message is shown on the screen until the field gains focus. As soon as the field gains focus jQuery Validation removes the customer server-side error message and marks the field as good.

    Read the article

  • Validation library PHP / Javascript

    - by pistacchio
    Hi, could someone recommend a PHP form validation library (that works independently outside of any php framework) that apart from doing all sort of basic validation (is empty, vs regex, is email, is alphanumeric and so on) can produce javascript code (ideally to work with jquery) to validate the very same form with the very same rules client-side and hence define validation rules in a single place and have a form validated both server and client side? Thanks.

    Read the article

  • Set Validation Tooltip in CodeBehind instead of XAML

    - by KrisTrip
    I would like to know how to translate the following code to codebehind instead of XAML: <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> The part I can't figure out is the Path portion. I have the following but it doesn't work: new Trigger { Property = Validation.HasErrorProperty, Value = true, Setters = { new Setter { Property = Control.ToolTipProperty, // This part doesn't seem to work Value = new Binding("(Validation.Errors)[0].ErrorContent"){RelativeSource = RelativeSource.Self} } } } Help?

    Read the article

  • ASP.NET MVC validation in weakly typed views

    - by Eedoh
    Hello. I have a problem validating data on view that is not strongly typed. I'm updating data from 3 different models on that view, and I have validation methods that work on them, but I don't know how to display the validation message. Where should I put validation messages (on strongly typed views I put them in ModelState, I presume that does not make sense in this case), and how should I display them (I doubt that I will be able to use "validationmessagefor", maybe "validationmessage" somehow)?

    Read the article

  • Livevalidation clientside validation - can you control the position of the validation messages?

    - by JK
    I'm using LiveValidaion for my clientside validation http://livevalidation.com/ and DataAnnotations for my validation rules. This all works fine except that the clientside error messages are only ever displayed to the right of the element being validated. Is it possible to move this validation message below the element being validated? Or even better, group all messages in a div at the top/bottom of the page? I dont see anything in their docs or examples

    Read the article

  • asp net mvc client validation with partial views and AJAX

    - by griZZZly8
    Hello, I'm using client validation function of the MVC 2.0 framework (with Html.ValidationMessageFor() and Html.EnableClientValidation()) Everything is nice, when I use the validation in a simple form. But when I get this form via jQuery AJAX $.get('PathToMyForm', function(htmlResult) { $('selector').html(htmlResult); }); client validation doesn't works.

    Read the article

  • Enterprise Library Validation Block - Should validation be placed on class or interface?

    - by Robert MacLean
    I am not sure where the best place to put validation (using the Enterprise Library Validation Block) is? Should it be on the class or on the interface? Things that may effect it Validation rules would not be changed in classes which inherit from the interface. Validation rules would not be changed in classes which inherit from the class. Inheritance will occur from the class in most cases - I suspect some fringe cases to inherit from the interface (but I would try and avoid it). The interface main use is for DI which will be done with the Unity block.

    Read the article

  • Doing a lot of input validation in VB.NET

    - by Andy
    I have a form set up where users can enter their booking for a room at my college. I want to validate the user input to avoid SQL injection (my program uses a MS Access database) and also stop numbers and synbols in their name, etc. I can do the validation fine, but there is to be a lot of validation and then methods executed only if all validation tests come back as true. I did have something like this: If txtName.Text = "" Then frmBookErr.SetError(txtName, "Name field cannot be left blank.") fail = 1 Else frmBookErr.SetError(txtName, "") fail = 0 End If And then check the fail variable, but it obviously gets overridden later in the form if one of the validation tests come back as true. Can anyone provide some input into this? Thanks.

    Read the article

  • DataAnnotations jQuery validation in asp.net mvc 2

    - by Anonimous
    Hi, I trying to use jQuery validation plugin with DataAnnotations in asp.net mvc 2 final. Now I'm using MicrosoftMvcValidation.js and it works. But I can't find way to work with jQuery validation. I read about MicrosoftMvcJQueryValidation.js. But I think that it is obsolete. How can I use DataAnnotations with jQuery validation plugin?

    Read the article

  • ASP.NET MVC 2 Client Side Validation doesn't work as advertised in VS2010

    - by Daniel Crenna
    In VS2010 and ASP.NET MVC 2, it seems that client-side validation (JQuery Futures or the stock option) doesn't quite work as advertised. I'm noticing that "tabbing off" a validated element will not invoke the client-side validation as promised. For a required field, you have to tab into the element, enter something, then remove it completely, in order to trigger the required validation. That's not really what I'm after here, and I'm hoping it's just a configuration issue on my side. How do I get the validation effects from previous versions so that a previous value isn't necessary (without having to modify the client-side scripts if possible)?

    Read the article

  • Data Validation of a Comma Delimited List

    - by Brad
    I need a simple way of taking a comma seperated list in a cell, and providing a drop down box to select one of them. For Example, the cell could contain: 24, 32, 40, 48, 56, 64 And in a further cell, using Data Validation, I want to provide a drop-down list to select ONE of those values I need to do this without VBA or Macros please. Apolgies, I want this to work with Excel 2010 and later. I have been playing around with counting the number of commas in the list and then trying to split this into a number of rows of single numbers etc with no joy yet.

    Read the article

  • What is the "opposite" of request serialization called?

    - by Adam Lindberg
    For example, if a request is made to a resource and another identical request is made before the first has returned a result, the server returns the result of the first request for the second request as well. This to avoid unnecessary processing on the resource. This is not the same thing as caching/memoization since it only concerns identical requests ongoing in parallel. Is there a term for the reuse of results for currently ongoing requests to a resource for the purpose of minimizing processing?

    Read the article

  • How to make per- http Request cache in ASP.NET 3.5

    - by Artem
    We using ASP.NET 3.5 (Controls-based apporach) and need to have storage specific for one http request only. Thread-specific cache with keys from session id won't work because threads are supposed to be pooled and therefore I have a chance to have data from some previous request in cache, which is undesireble in my case. I always need to have brand new storage for each request available through whole request. Any ideas how to do it in ASP.NET 3.5?

    Read the article

  • jQuery Validate - require at least one field in a group to be filled

    - by Nathan Long
    I'm using the excellent jQuery Validate Plugin to validate some forms. On one form, I need to ensure that the user fills in at least one of a group of fields. I think I've got a pretty good solution, and wanted to share it. Please suggest any improvements you can think of. Finding no built-in way to do this, I searched and found Rebecca Murphey's custom validation method, which was very helpful. I improved this in three ways: To let you pass in a selector for the group of fields To let you specify how many of that group must be filled for validation to pass To show all inputs in the group as passing validation as soon as one of them passes validation. So you can say "at least X inputs that match selector Y must be filled." The end result is a rule like this: partnumber: { require_from_group: [2,".productinfo"] } //The partnumber input will validate if //at least 2 `.productinfo` inputs are filled For best results, put this rule AFTER any formatting rules for that field (like "must contain only numbers", etc). This way, if the user gets an error from this rule and starts filling out one of the fields, they will get immediate feedback about the formatting required without having to fill another field first. Item #3 assumes that you're adding a class of .checked to your error messages upon successful validation. You can do this as follows, as demonstrated here. success: function(label) { label.html(" ").addClass("checked"); } As in the demo linked above, I use CSS to give each span.error an X image as its background, unless it has the class .checked, in which case it gets a check mark image. Here's my code so far: jQuery.validator.addMethod("require_from_group", function(value, element, options) { // From the options array, find out what selector matches // our group of inputs and how many of them should be filled. numberRequired = options[0]; selector = options[1]; var commonParent = $(element).parents('form'); var numberFilled = 0; commonParent.find(selector).each(function(){ // Look through fields matching our selector and total up // how many of them have been filled if ($(this).val()) { numberFilled++; } }); if (numberFilled >= numberRequired) { // This part is a bit of a hack - we make these // fields look like they've passed validation by // hiding their error messages, etc. Strictly speaking, // they haven't been re-validated, though, so it's possible // that we're hiding another validation problem. But there's // no way (that I know of) to trigger actual re-validation, // and in any case, any other errors will pop back up when // the user tries to submit the form. // If anyone knows a way to re-validate, please comment. // // For imputs matching our selector, remove error class // from their text. commonParent.find(selector).removeClass('error'); // Also look for inserted error messages and mark them // with class 'checked' var remainingErrors = commonParent.find(selector) .next('label.error').not('.checked'); remainingErrors.text("").addClass('checked'); // Tell the Validate plugin that this test passed return true; } // The {0} in the next line is the 0th item in the options array }, jQuery.format("Please fill out at least {0} of these fields.")); Questions? Comments?

    Read the article

  • copying the request header from request object to urlConnection object

    - by Bunny Rabbit
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub URL url = new URL("http://localhost:8080/testy/Out"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod("POST"); PrintWriter out=response.getWriter(); for(Enumeration e=request.getHeaderNames();e.hasMoreElements();){ Object o=e.nextElement(); String value=request.getHeader(o.toString()); out.println(o+"--is--"+value+"<br>"); connection.setRequestProperty((String) o, value); } connection.connect(); } i wrote the above code in a servlet to post form so some alternate locations than this servlet,but its not working.is it okay to use connection.setRequestProperty to set the header fields to what they are in the incoming request to servlet.

    Read the article

  • How to validate HTTP request headers before receiving request body using WCF

    - by anelson
    I'm implementing a REST service using WCF which will be used to upload very large files. The HTTP headers in this request will communicate information which will be validated prior to allowing the upload to proceed (things like permissions, available disk space, etc). It's possible this validation will fail resulting in an error response. I'd like to do this validation prior to the client sending the body of the request, so it has a chance to detect failure before uploading potentially gigabytes of data. RESTful web services use the HTTP 1.1 Expect: 100-continue in the request to implement this. For example Amazon S3's REST API can validate your key and ACLs in response to an object PUT operation, returning 100 Continue if all is well, indicating you may proceed to send your data. I've rummaged around the WCF documentation and I just can't see a way to accomplish this without doing some pretty low-level hooking into the HTTP request processing pipeline. How would you suggest I solve this problem?

    Read the article

  • Entlib validation to syntax to accept only numeric month numbers?

    - by ElHaix
    I've got an enum defined as such: Private Enum AllowedMonthNumbers _1 _2 _3 _4 _5 _6 _7 _8 _9 _10 _11 _12 End Enum Then a property validator defined as: <TypeConversionValidator(GetType(Int32), MessageTemplate:="Card expiry month must be numeric.", Ruleset:="CreditCard")> _ <EnumConversionValidator(GetType(AllowedMonthNumbers), MessageTemplate:="Card expiry month must be between 1 and 12.", Ruleset:="CreditCard")> _ The validation expects "_#", as when I remove the TypeConversionValidator, it passes with setting the value to "_3" or any other number in the enum. What I need is for this to only accept b/t 1-12, and simply having numeric values in the enum won't work. Any tips? Thanks. UPDATE I replaced the EnumConversionValidator with a RangeValidator, and attempting to set the parameter to "1", but received the following error: <RangeValidator(1, RangeBoundaryType.Inclusive, 12, RangeBoundaryType.Inclusive, MessageTemplate:="..."> However that's now giving me the following error: System.Web.Services.Protocols.SoapException : System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Object must be of type Int32. at System.Int32.CompareTo(Object value) at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RangeChecker`1.IsInRange(T target) at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.RangeValidator`1.DoValidate(T objectToValidate, Object currentTarget, String key, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validator`1.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.AndCompositeValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.ValueAccessValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.AndCompositeValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.GenericValidatorWrapper`1.DoValidate(T objectToValidate, Object currentTarget, String key, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validator`1.Validate(T target, ValidationResults validationResults) at Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate[T](T target, String[] rulesets) at ....

    Read the article

  • Spiceworks versus Request Tracker?

    - by dmackey
    We currently utilize Request Tracker for help desk ticketing, we utilize Spiceworks for asset inventorying. I am pondering whether it might be worthwhile to move from RT to Spiceworks for help desk as well. Has anyone used both systems and can provide some insight into any benefits/problems with either system? Or has general philosophical reasons why one should use one solution over the other? Of course, RT is open source and Spiceworks is not - and usually this would be a major item for me - but since Spiceworks is free and takes community involvement fairly actively its not as major of a concern for me (personally).

    Read the article

  • Apache Connection vs. Request

    - by user101570
    I apologize in advance if this is a basic question, but I am quite confused after reading the Apache documentation and other tutorials. Does a single Apache prefork process serve all HTTP requests for a given client? That's what I thought, but when I reduce maxclients down to a low number, my page load times go to a crawl. This despite the fact I'm the only client on the server in question. This would suggest each process serves a single HTTP request at a time, rather than serving all requests within the TimeOut window. So if a single webpage requires 15 HTTP requests to load fully, do I require 15 prefork Apache processes to optimally serve it?

    Read the article

  • Classic ASP Request.Form removes spaces?

    - by alex
    I'm trying to figure this oddity out... in classic ASP i seem to be losing spaces in Request.Form values... ie, Request.Form("json") is {"project":{"...","administrator":"AlexGorbatchev", "anonymousViewUrl":null,"assets":[],"availableFrom":"6/10/20104:15PM"... However, CStr(Request.Form) is json={"project":{"__type":"...":"Alex Gorbatchev", "anonymousViewUrl":null,"assets":[],"availableFrom":"6/10/2010 4:15 PM"... Here's the entire code :) <%@ language="VBSCRIPT"%> <% Response.Write(CStr(Request.Form("json"))) Response.Write(CStr(Request.Form)) %> Somebody please tell me I haven't lost all my marbles...

    Read the article

  • ASP.NET binding object to Request in asp.net mvc

    - by Alxandr
    I've created a object that I'd like to have accessible from wherever the request-object is accessible, and to "die" with the request, more or less like how you always in a mvc-application has access to the RouteData-collection. Especially it's important that I have access to this object in the execution of action-filters. And also there need to be created a new object of my class whenever a new request is made to the page (the object needs to be request-safe, ie. only one request modifies that one object). Any thoughts about how to achieve this?

    Read the article

  • How to By Pass Request Validation

    - by GIbboK
    Hi, I have a GridView and I need update some data inserting HTML CODE; I would need this data been stored encoded and decoded on request. I cannot in any way disable globally "Request Validation" and not even at Page Level, so I would need a solution to disable "Request Validation" at Control Level. At the moment I am using a script which should Html.Encode every value being update, butt seems that "Request Validation" start its job before event RowUpdating, so I get the Error "Page A potentially dangerous Request.Form ... ". Any idea how to solve it? Thanks protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { foreach (DictionaryEntry entry in e.NewValues) { e.NewValues[entry.Key] = Server.HtmlEncode(entry.Value.ToString()); } PS I USE Wweb Controls not MVC

    Read the article

  • Django: request object to template context transparancy

    - by anars
    Hi! I want to include an initialized data structure in my request object, making it accessible in the context object from my templates. What I'm doing right now is passing it manually and tiresome within all my views: render_to_response(...., ( {'menu': RequestContext(request)})) The request object contains the key,value pair which is injected using a custom context processor. While this works, I had hoped there was a more generic way of passing selected parts of the request object to the template context. I've tried passing it by generic views, but as it turns out the request object isn't instantiated when parsing the urlpatterns list.

    Read the article

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