Search Results

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

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

  • Custom Validation - Dependent Drop Down Lists

    - by Holysmoke
    Hi, I've two columns in a sheet that are interdependent and I want to use validation, drop-down lists, on both as follows: Column A (TYPE) | Column B (Sub-TYPE) ------------------------------------------| TypeA, TypeB | If TypeA SubTypeA1, | ... TypeN | SubTypeA2 ... SubTypeAN | ------------------------------------------| Creating the column A drop down is trivial. How do I create the Column B drop down, that in turn depends on what was chosen in Column A? TIA

    Read the article

  • Why is this UL and inline JS giving errors during HTML validation?

    - by thor
    I've just run the homepage of a site I'm working on through the w3c HTML validator and it's come back with 3 errors and 2 warnings. I've taken a look at them but can't see why they would be causing a problem. I've pasted them in below (I've removed URL's/strings etc as the site isn't quite ready to be made public yet). This is being validated against XHTML Transitional by the way. The UL comes back with the following error: end tag for "ul" which is not finished <ul id='tabs'></ul> <ul id='tabs'> <li> <a href="/en/folder/folder/search?categories[]=cat1" class="tab1" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab1_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat2" class="tab2" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab2_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat3" class="tab3" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab3_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat4" class="tab4" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab4_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat5" class="tab5" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab5_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat6" class="tab6" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab6_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat7" class="tab7" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab7_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat8" class="tab8" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab8_text </span> </a> </li> </ul> For the inline javascript, I'm getting 2 errors and 2 warnings all for the same thing - I have a simple if statement with && and the validator appears to be seeing this as HTML rather than javascript: character "&amp;" is the first character of a delimiter but occurred as data and xmlParseEntityRef: no name <script type='text/javascript'> if (weather_data != null && weather_data['data'] != null){ display_weather(); } </script> The javascript is placed just before the body close tag at the end of the document. If you need to see the full source then let me know and I can send it over.

    Read the article

  • Pull Request Changes, Multi-Selection in Advanced View, and Advertisement Changes

    [Do you tweet? Follow us on Twitter @matthawley and @adacole_msft] We deployed a new version of the CodePlex website today. Pull Request Changes In this release, we have begun to re-focus on Pull Requests to ensure a productive experience between the project users and developers. We feel we made significant progress in this area for this release and look forward to using your feedback to drive future iterations. One of the biggest hurdles people have indicated is the inability to see what a pull request includes without pulling the source down from a Mercurial client. With today’s changes, any user has the ability to view a pull request, the changesets / changes included, and perform an inline diff of the file. When a pull request is made, the CodePlex website will query for all outgoing changes from the fork to the main repository for a point-in-time comparison. Because of this point-in-time comparison… All existing pull requests created prior to this release will not have changesets associated with them. If new commits are pushed to the fork while a pull request is active, they will not appear associated with the pull request. The pull request will need to be re-submitted for them to appear. Once a pull request is created, you can “View the Pull Request” which takes you to a page that looks like As you may notice, we now display a lot more detailed information regarding that pull request including who it was requested by and when, the associated changesets, the description, who it’s assigned to (we’ll come back to this) and the listing of summarized file changes. What you’ll also notice, is that each modified file has the ability to view a diff of all changes made. When you click “(view diff)” for a file, an inline diff experience appears. This new experience allows you to quickly navigate through all of the modified files as well as viewing the various change blocks for each file. You’ll also notice as you browse through each file’s changes, we update the URL to include the file path so you can quickly send a direct link to a pull request’s file. Clicking “(close diff)” will bring you back to the original pull request view. View this pull request live on WikiPlex. Pull Request Review Assignment Another new feature we added for pull requests is the ability for project members to assign pull requests for review. Any project member has the ability to assign (and re-assign if needed) a pull request to a project member. Once the assignment has been made, that project member will be notified via email of the assignment. Once they complete the review of the pull request, they can either accept or deny it similarly to the previous process. Multi-Selection in Advanced View Filters One of the more recent requests we have heard from users is the ability multi-select advanced view filters for work items. We are happy to announce this is now possible. Simply control-click the multiple options for each filter item and your work item query will be refined as such. Should you happen to unselect all options for a given filter, it will automatically reset to the default option for that filter. Furthermore, the “Direct Link” URL will be updated to include the multi-selected options for each filter. Note: The “Direct Link” feature was released in our previous deployment, just never written about. It allows you to capture the current state of your query and send it to other individuals. Advertisement Changes Very recently, the advertiser (The Lounge) we partnered to provide advertising revenue for projects, or donated to charity, was acquired by Lake Quincy Media. There has been no change in the advertising platform offering, and all projects have been converted over to using the new infrastructure. Project owners should note the new contact information for getting paid. The CodePlex team values your feedback, and is frequently monitoring Twitter, our Discussions and Issue Tracker for new features or problems. If you’ve not visited the Issue Tracker recently, please take a few moments to log an idea or vote for the features you would most like to see implemented on CodePlex.

    Read the article

  • How do I make a Data Validation drop-down exclude blanks?

    - by Iszi
    Related: How can I use non-adjacent cells on another sheet for a Data Validation drop-down, and only show non-blank values? For now, I've worked around the above problem by re-arranging my sheet so all the Data Validation Source cells are in one range. I'm leaving the above question open though, because I think it still poses an interesting problem. However, the issue now is that the Data Validation drop-down isn't working in the way I expected it to (and how I believe others are telling me it should). Even though I've got everything into one named range, Excel still shows blanks in a drop-down that references that range. Setup: Sheet 1 A1= (blank) B1= Header A2= 1 B2= Value1 A3= 2 B3= Value2 A4= 3 B4= Value3 A5= 4 B5= (empty) A6= 5 B6= (empty) A7= 6 B7= (empty) Sheet1!B2:B7 is named Validation Sheet2!A1 is set to use Data Validation with a Source =Validation, and in-cell drop-down. The drop-down in Sheet2!A1 shows: Value1 Value2 Value3 . . . (Dots represent blank lines) How can I get rid of these blank lines in the in-cell drop-down, while still including Sheet1!B5:B7 in the Data Validation Source? Note: I nuked the sheet, and tried it again without column A from Sheet1 (putting values from column B in the above example into column A), and it worked fine. Adding Column A back though, brought the blanks back into the Data Validation drop-down. What do I need to do to keep column A as I want it and keep the in-cell drop-down clean?

    Read the article

  • webservice request issue with dynamic request inputs

    - by nanda
    try { const string siteURL = "http://ops.epo.org/2.6.1/soap-services/document-retrieval"; const string docRequest = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><soap:Body><document-retrieval id='EP 1000000A1 I ' page-number='1' document-format='SINGLE_PAGE_PDF' system='ops.epo.org' xmlns='http://ops.epo.org' /></soap:Body></soap:Envelope>"; var request = (HttpWebRequest)WebRequest.Create(siteURL); request.Method = "POST"; request.Headers.Add("SOAPAction", "\"document-retrieval\""); request.ContentType = " text/xml; charset=utf-8"; Stream stm = request.GetRequestStream(); byte[] binaryRequest = Encoding.UTF8.GetBytes(docRequest); stm.Write(binaryRequest, 0, docRequest.Length); stm.Flush(); stm.Close(); var memoryStream = new MemoryStream(); WebResponse resp = request.GetResponse(); var buffer = new byte[4096]; Stream responseStream = resp.GetResponseStream(); { int count; do { count = responseStream.Read(buffer, 0, buffer.Length); memoryStream.Write(buffer, 0, count); } while (count != 0); } resp.Close(); byte[] memoryBuffer = memoryStream.ToArray(); System.IO.File.WriteAllBytes(@"E:\sample12.pdf", memoryBuffer); } catch (Exception ex) { throw ex; } The code above is to retrieve the pdf webresponse.It works fine as long as the request remains canstant, const string docRequest = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><soap:Body><document-retrieval id='EP 1000000A1 I ' page-number='1' document-format='SINGLE_PAGE_PDF' system='ops.epo.org' xmlns='http://ops.epo.org' /></soap:Body></soap:Envelope>"; but how to retrieve the same with dynamic requests. When the above code is changed to accept dynamic inputs like, [WebMethod] public string DocumentRetrivalPDF(string docid, string pageno, string docFormat, string fileName) { try { ........ ....... string docRequest = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><soap:Body><document-retrieval id=" + docid + " page-number=" + pageno + " document-format=" + docFormat + " system='ops.epo.org' xmlns='http://ops.epo.org' /></soap:Body></soap:Envelope>"; ...... ........ return "responseTxt"; } catch (Exception ex) { return ex.Message; } } It return an "INTERNAL SERVER ERROR:500" can anybody help me on this???

    Read the article

  • 502: proxy: pass request body failed

    - by Apikot
    Sometimes I get the following error (in apache's error.log) when viewing my site over https: (502)Unknown error 502: proxy: pass request body failed to xxx.xxx.xxx.xxx:443 I'm not entirely sure what this is and why it happens, it's also not consistent. The request route is: Browser Proxy server (apache with mod_proxy + mod_ssl) Load balancer (aws) Web server (apache with mod_ssl) The configuration on the proxy server is as follows: <VirtualHost *:443> ProxyRequests Off ProxyVia On ServerName www.xxx.co.uk ServerAlias xxx.co.uk <Directory proxy:*> Order deny,allow Allow from all </Directory> <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy> ProxyPass / balancer://cluster:443/ lbmethod=byrequests ProxyPassReverse / balancer://cluster:443/ ProxyPreserveHost off SSLProxyEngine On SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /var/www/vhosts/xxx/ssl/www.xxx.co.uk.cert SSLCertificateKeyFile /var/www/vhosts/xxx/ssl/www.xxx.co.uk.key <Proxy balancer://cluster> BalancerMember https://xxx.eu-west-1.elb.amazonaws.com </Proxy> </VirtualHost> Any idea what the issue might be?

    Read the article

  • ASP.NET Ajax.BeginForm Posts Even If Validation Fails

    - by Acoustic
    I'm just overlooking something simple... but my form, which is an Ajax form, always submits even if the validation fails. I'm not using jQuery validation, just the standard .NET MVC validation. Each of the field failing get show the validation message and highlight the field, but the form just submits anyway. Is there an OnBegin script I can call to prevent the form from submitting if there are errors? Thanks for the help! Ajax.BeginForm("EditUserProfile", new AjaxOptions { HttpMethod = "Post", OnComplete = ToggleViews", UpdateTargetId ="userProfileContainer" })

    Read the article

  • Spring MVC jQuery remote validation

    - by raulsan
    Hi, I am using Spring MVC on the server side, but in one of the pages I decided to create an AJAX validation with jQuery rather than the default Spring validation. Everything works great, except when I have to do a remote validation to check if a "title" already exists. For the javascript I have the following: var validator = $("form").validate({ rules: { title: { minlength: 6, required: true, remote: { url: location.href.substring(0,location.href.lastIndexOf('/'))+"/checkLocalArticleTitle.do", type: "GET" } }, html: { minlength: 50, required: true } }, messages: { title: { required: "A title is required.", remote: "This title already exists." } } }); Then, I use Spring-Json to make this validation and give a response: @RequestMapping("/checkLocalArticleTitle.do") public ModelAndView checkLocalArticleTitle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Map model = new HashMap(); String result = "FALSE"; try{ String title = request.getParameter("title"); if(!EJBRequester.articleExists(title)){ result = "TRUE"; } }catch(Exception e){ System.err.println("Exception: " + e.getMessage()); } model.put("result",result); return new ModelAndView("jsonView", model); } However, this does not work and the field "title" is never validated. I think the reason for this is that I am returning an answer in the manner: {result:"TRUE"} when in fact, the answer should be: {"TRUE"} I don't know how to return a single response like this one using a ModelAndView answer. Another thing that is not working is the customized message for the "remote" validation: messages: { title: { required: "A title is required.", remote: "This title already exists." } }, The required message works, but not the remote message. I looked around, but I didn't see many people using Spring and jQuery at the same time. I would appreciate some help here.

    Read the article

  • Validation plugin hijacks click function?

    - by timkl
    Absolute newbie question, any help is highly appreciated :) I am using curvycorners (http://www.curvycorners.net/) in combination with the jQuery validation plugin (http://bassistance.de/jquery-plugins/jquery-plugin-validation/), and I'm having problems getting the div to redraw the rounded corners when I do like this: $("input[type='submit']").click(function(e) { curvyCorners.redraw(); }); When I click the submit-button the first time the form validates, the validation error-message pops up and expands the div, causing the layout to go ugly. However when I click on it the second time the rounded corners redraw nicely. Could it be that my validation plugin hijacks my initial click? How do I go about this? Any hint is very much appreciated.

    Read the article

  • Please help! request compression

    - by Naor
    Hi, I wrote an IHttpModule that compress my respone using gzip (I return a lot of data) in order to reduce response size. It is working great as long as the web service doesn't throws an exception. In case exception is thrown, the exception gzipped but the Content-encoding header is disappear and the client doesn't know to read the exception. How can I solve this? Why the header is missing? I need to get the exception in the client. Here is the module: public class JsonCompressionModule : IHttpModule { public JsonCompressionModule() { } public void Dispose() { } public void Init(HttpApplication app) { app.BeginRequest += new EventHandler(Compress); } private void Compress(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; HttpRequest request = app.Request; HttpResponse response = app.Response; try { //Ajax Web Service request is always starts with application/json if (request.ContentType.ToLower(CultureInfo.InvariantCulture).StartsWith("application/json")) { //User may be using an older version of IE which does not support compression, so skip those if (!((request.Browser.IsBrowser("IE")) && (request.Browser.MajorVersion <= 6))) { string acceptEncoding = request.Headers["Accept-Encoding"]; if (!string.IsNullOrEmpty(acceptEncoding)) { acceptEncoding = acceptEncoding.ToLower(CultureInfo.InvariantCulture); if (acceptEncoding.Contains("gzip")) { response.AddHeader("Content-encoding", "gzip"); response.Filter = new GZipStream(response.Filter, CompressionMode.Compress); } else if (acceptEncoding.Contains("deflate")) { response.AddHeader("Content-encoding", "deflate"); response.Filter = new DeflateStream(response.Filter, CompressionMode.Compress); } } } } } catch (Exception ex) { int i = 4; } } } Here is the web service: [WebMethod] public void DoSomething() { throw new Exception("This message get currupted on the client because the client doesn't know it gzipped."); } I appriciate any help. Thanks!

    Read the article

  • adding jquery validation after form created

    - by CoffeeCode
    im using a jquery validation plugin first i add the validation to the form: $('#EmployeeForm').validate({ rules: { "Employee.FirstName": "required", "Employee.PatronymicName": "required", "Employee.LastName": "required", "Employee.BirthDay": { required: true, date: true } }, messages: { "Employee.FirstName": { required: "*" }, "Employee.PatronymicName": { required: "*" }, "Employee.LastName": { required: "*" }, "Employee.BirthDay": { required: "*", date: "00.00.00 format" } } }); and then latter a need to add validation rules to other form elements: $('#Address_A.Phone1, #Address_A.Phone2, #Address_B.Phone1, #Address_B.Phone2').rules("add", { digits: true, messages: { digits: "?????? ?????" } }); but i get an error: 'form' is null or not an object i check, the form and all the elements in it are created before i add validation to it. cant figer out whats wrong.

    Read the article

  • Kohana 3: Example of model with validation

    - by Svish
    I find examples and tutorials about models and about validation. And I places that say the validation (or most of it at least) should be in the model, which I agree with. But I can't any examples or tutorials that show how that should be done. Could anyone help me with a simple example on how that could be done? Where would you have the rules in the model? Where would the validation happen? How would the controller know if the validation passed or fail? How would the controller get error messages and things like that? Hope someone can help, cause feel a bit lost here :p

    Read the article

  • jQuery / Spry Validation / Problem

    - by samuel baldus
    Hi Chaps, I have a PHP form with one input and a button. A jQuery script ('loading' animated gif) is triggered on the click of the submit button. I also have a Spry Validation field linked to the input. At the moment, if the validation is triggered, the animated gif continues and won't stop. The furthest I've managed to get with it, is to click the validation message to stop the animation, but what I'm really after is to stop the animation when the validation is visible/triggered, but I can't find a suitable Event. $(function() { $("#button_download") .click(function() { }) .throbber(); $("#sprytextfield1") .click(function(sprytextfield1) { $.throbberHide(); }) }); If someone can point me in the right direction, that would be sweet.

    Read the article

  • jQuery Validation plugin with JQGrid?

    - by Herb Caudill
    Has anyone successfully used the jQuery Validation plugin with JQGrid? I realize that JQGrid has its own validation scheme, but it's limited and a little clumsy; and I'd prefer to reuse the validation UI, language, and rules that I'm using with the rest of my forms.

    Read the article

  • ASP.NET MVC 2.0 Client-Side Validation HOWTO

    - by AlexWalker
    Where can I find some good information on the new client-side validation functionality included in ASP.NET MVC v2? I'd like to find information about using the client-side validation JavaScript without using DataAnnotations, and I'd like to find out how custom validations are handled. For example, if I want to validate two fields together, how would I utilize the provided JavaScript? Or if I wanted to write validation code on the server-side that queried a database, how could I use the provided JavaScript to implement a similar validation? I don't see any books on MVC2 yet, and the blog entries I've found are not detailed enough.

    Read the article

  • Does Java Spring 3.0 MVC support annotation/attribute based client side validation like Asp.net MVC

    - by Athens
    In Asp.Net MVC 2.0, at least in the beta, you could decoration your model classes with data annotation attributes and enable client side validation that leverages that criteria defined in your model data annotation attibutes. Is there anything similar for Java Spring MVC 3.0? Is it possible to inject a component into the response pipeline that can inspect the model's annotated properties and render client side validation logic to complement the server side validation logic that is invoked prior to the controller handling the request?

    Read the article

  • validation control unable to find its control to validate

    - by nat
    i have a repeater that is bound to a number of custom dataitems/types on the itemdatabound event for the repeater the code calls a renderedit function that depending on the custom datatype will render a custom control. it will also (if validation flag is set) render a validation control for the appropriate rendered edit control the edit control overrides the CreateChildControls() method for the custom control adding a number of literalControls thus protected override void CreateChildControls() { //other bits removed - but it is this 'hidden' control i am trying to validate this.Controls.Add(new LiteralControl(string.Format( "<input type=\"text\" name=\"{0}\" id=\"{0}\" value=\"{1}\" style=\"display:none;\" \">" , this.UniqueID , this.MediaId.ToString()) )); //some other bits removed } the validation control is rendered like this: where the passed in editcontrol is the control instance of which the above createchildcontrols is a method of.. public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.UniqueID; req.Display = ValidatorDisplay.Dynamic; req.InitialValue = "0"; req.ErrorMessage = this.Caption + " cannot be blank"; ctrl.Controls.Add(req); return ctrl; } the problem is, altho the validation controls .ControlToValidate property is set to the uniqueid of the editcontrol. when i hit the page i get the following error: Unable to find control id 'FieldRepeater$ctl01$ctl00' referenced by the 'ControlToValidate' property of 'FieldRepeater_ctl01_ctl00_validator'. i have tried changing the literal in the createchildcontrols to a new TextBox(), and then set the id etc then, but i get a similar problem. can anyone enlighten me? is this because of the order the controls are rendered in? ie the validation control is written before the editcontrol? or... anyhow any help much appreciated thanks nat

    Read the article

  • JavaScript: input validation in the keydown event

    - by c411
    Hi, I'm attempting to do info validation against user text input in the process of keydown event. The reason that I am trying to validate in the keydown event is because I do not want to display the characters those that are considered to be illegal in the input box at the beginning. The validation I am writing is like this, function validateUserInput(){ var code = this.event.keyCode; if ((code<48||code>57) // numerical &&code!==46 //delete &&code!==8 //back space &&code!==37 // <- arrow &&code!==39) // -> arrow { this.event.preventDefault(); } } I can keep going like this, however I am seeing drawbacks on this implmentation. Those are, for example, Conditional statement become longer and longer when I put more conditions to be examined. keyCodes can be different by browsers. I have to not only check what is not legal but also have to check what are exceptionals. In above examples, delete,backspace, and arrow keys are exceptionals. But the feature that I don't want to lose is having not to display the input in the textarea unless it passes the validation. (In case the user try to put illegal characters in the textarea, nothing should appear at all) That is why I am not doing validation upon keyup event. So my question is, Are there better ways to validate input in keydown event than checking keyCode by keyCode? Are there other ways to capture the user inputs other than keydown event before browser displays it? And a way to put the validation on it? Thanks for the help in advance.

    Read the article

  • Form validation Issue

    - by Nimbuz
    I am using jQuery validation plugin for form validation. The problem I am facing is when I have inline labels.. For Example: <input type="text" name="myinput" value="Enter your ...."> This is the sample case where validation is failing because the 'value' is set for input field. Is there any workaround? How do I ignore default/label values?

    Read the article

  • MVC2 Client-Side Validation for injected Ajax response

    - by radu-negrila
    Hi, I have the following scenario for an MVC 2 website. The user checks a radio. I make a jQuery GET to retrieve some html (partial view + view model). The view-model is annotated with validation attributes. I need client-side validation for the new html's inputs. I tried placing the following line in the partial view: <% Html.EnableClientValidation(); % I was naive. Also for the obtained html I use jQuery's .html to populate my placeholder, which also would execute the javascript. Not that there is any. Is is possible to update the page's validation logic and metadata after the ajax call ? Any ideas (beside remote client side validation) ? Thanks in advance.

    Read the article

  • Multiple schema validation in Java

    - by user279554
    Hi, I am trying to do multiple schema validation in Java. I don't understand where I am doing wrong. Any help will be appreciated. abc.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xn="project-xml-r4j_another.xsd"> <xsd:import namespace="project-xml-r4j_another.xsd"/> <xsd:element name="abc" type="abc"> </xsd:element> <xsd:complexType name="abc"> <xsd:sequence> <xsd:element name="test" type="test" minOccurs="0" maxOccurs="1"> </xsd:element> <!--<xsd:element name="proj" type="xn:proj"/>--> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID" use="required"/> </xsd:complexType> <xsd:complexType name="test"> <xsd:attribute name="id" type="xsd:ID" use="required"></xsd:attribute> <xsd:attribute name="value" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="100" /> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:schema> project-xml-r4j_another.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="project-xml-r4j_another.xsd" xmlns="project-xml-r4j_another.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:element name="proj" type="proj"> <xsd:annotation> <xsd:documentation> The project is the root tag of a project-xml. </xsd:documentation> </xsd:annotation> </xsd:element> <xsd:complexType name="proj"> <xsd:attribute name="id" type="xsd:ID" use="required"/> </xsd:complexType> </xsd:schema> Test case package test; import java.io.File; import java.io.IOException; import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; import org.apache.log4j.Logger; import org.junit.Test; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; import com.ericsson.ccrtool.core.project.projectxml.InvalidProjectXmlException; public class TestSchema { private static final Logger logger = Logger.getLogger(TestSchema.class); static final String W3C_XML_SCHEMA = XMLConstants.W3C_XML_SCHEMA_NS_URI; @Test public void test() { System.out.println("TestSchema.test()"); try { SchemaFactory schemaFactory = SchemaFactory.newInstance(W3C_XML_SCHEMA); // create a grammar object. Source [] source = { new StreamSource(new File("C:\\jaydeep\\Ericsson\\R5B\\abc.xsd")), new StreamSource(new File("C:\\jaydeep\\Ericsson\\R5B\\project-xml-r4j.xsd"))}; Schema schemaGrammar = schemaFactory.newSchema(source); Validator schemaValidator = schemaGrammar.newValidator(); schemaValidator.setErrorHandler(new MessageHandler()); // validate xml instance against the grammar. schemaValidator.validate(new StreamSource("C:\\jaydeep\\Ericsson\\R5B\\project_tmmk17cells_xnaveen_project-xml.xml")); } catch (SAXException e) { throw new InvalidProjectXmlException("Project-xml validation failed, Exception: " + e.getMessage(), e); } catch (IOException e) { throw new InvalidProjectXmlException("Project-xml validation failed, Exception: " + e.getMessage(), e); } } class MessageHandler extends DefaultHandler { private String errMessage = ""; @Override public void warning(SAXParseException e) { logger.info("Warning Line " + e.getLineNumber() + ": " + e.getMessage()); } @Override public void error(SAXParseException e) { errMessage = new String("Error Line " + e.getLineNumber() + ": " + e.getMessage()); logger.info(errMessage); throw new InvalidProjectXmlException("Project-xml validation failed, Exception: " + errMessage); } @Override public void fatalError(SAXParseException e) { errMessage = new String("Error Line " + e.getLineNumber() + ": " + e.getMessage()); logger.info(errMessage); throw new InvalidProjectXmlException("Project-xml validation failed, Exception: " + errMessage); } } } Thanks, Jaydeep

    Read the article

  • wcf generated classes and validation application block attributes

    - by Shaboboo
    Hi, I'm new to the validation application block and trying to use it with wcf... I have a wcf service that has data objects with validation rules defined with attributes, using the validation application block . On my client side (WPF), I have a service reference. When I update the service reference the generated classes do not have the validation rules attributes in them. How can I get the rules from the service? Am I missing some step, or is it not possible?

    Read the article

  • Jquery Validation Watermark

    - by Sandeep
    I am using jQuery validation plugin and Watermark plugin. The problem I am facing is when i applied a watermark to any input field for which validation is also applied then validations are failing For Example: <input type=text name=myinput class="required"> and I applied a watermark for this field in document ready function: $("#myinput ").Watermark("myinput "); This is the sample case where validation is failing as value=myinput is set for input field which is watermarked.

    Read the article

  • Codeigniter validation help

    - by Drew McGhie
    I'm writing a system where users can generate/run queries on demand based on the values of 4 dropdown lists. The lists are dynamically generated based on a number of factors, but at this point, I'm having problems validating the input using codeigniter's built in validation classes. I think I have things out of order, and I've tried looking at the codeigniter site, but I think I'm tripping myself up. in my view(/dashboard/dashboard_index.php), I have the following code block: <?=form_open('dashboard/dashboard_add');?> <select ... name='selMetric'> <select ... name='selPeriod'> <select ... name='selSpan'> <select ... name='selTactic'> <input type="submit" name="submit_new_query" value="Add New Graph" class="minbutton" ></input> <?=form_close();?> Then in my controller, I have the following 2 methods: function index() { $this->load->helper(array('form', 'url')); $this->load->library('validation'); //population of $data $this->load->tile('dashboard/dashboard_index', $data); } function dashboard_add() { $rules['selMetric'] = "callback_sel_check"; $rules['selPeriod'] = "callback_sel_check"; $rules['selSpan'] = "callback_sel_check"; $rules['selTactic'] = "callback_sel_check"; $this->validation->set_rules($rules); $fields['selMetric'] = "Metric"; $fields['selPeriod'] = "Time Period"; $fields['selSpan'] = "Time Span"; $fields['selTactic'] = "Tactic"; $this->validation->set_fields($fields); if ($this->validation->run() == false) { $this->index(); } else { //do stuff with validation information } } Here's my issue. I can get the stuff to validate correctly, but for the number of errors I have, I get Unable to access an error message corresponding to your field name. as the error message for everything. I think my issue that I have the $rules and $fields stuff in the wrong place, but I've tried a few permutations and I just keep getting it wrong. I was hoping I could get some advice on the correct place to put things.

    Read the article

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