Search Results

Search found 10041 results on 402 pages for 'validation controls'.

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

  • 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

  • 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

  • How can i create a submitable form that contains dynamically added and removed controls

    - by bill
    Hi All, I am trying to create a form that is made up of controls with values that represent an entity with multiple child entities. The form will represent a product with multiple properties where the user will then be able to create options with multiple properties which in turn be able to create multiple option-items with multiple properties. My question is what is the best approach? Can i use ajax to avoid postbacks and having to rewrite the controls to the page? If i dynamically add the controls in the form of table rows or grid rows will the data/control values be available in the code-behind when i submit? This is an age old question.. the last time i had to do this was .Net 2.0, pre-ajax (for me) and i was forced to recreate all the controls on each post back. thanks!

    Read the article

  • divert asp.net child controls

    - by Eric
    Hi Folks, I am trying to create an asp.net custom control that acts as a hosting container for any other controls, similar to the existing ‘Panel’ control. Basically, I need to build a web control that groups a bunch of other controls. It will consist of a header and a body pane, similar to a normal window in desktop application. The header will contain some simple text and some JavaScript driven code that shows/hides the body pane. The body pane simply hosts any number of other controls. +------------------------------------------------------+ | User Details Show/Hide | +------------------------------------------------------+ | Name: [Eric ] | | Address: [Some where] | | Date of Birth: [01/01/1980] | | | | (any other fields goes on) | | | | | +------------------------------------------------------+ Ideally I want to create a control that packs the whole thing together, so at design time I could use the following markup. <myCtl:SuperContainer runat=”server” Title=”User Details”> <asp:label id=”lblName” runat=”server” text=”Name:”/> <asp:textbox id=”txtName” runat=”server”/> <asp:label id=”lblDOB” runat=”server” text=”Date of Birth:”/> <asp:textbox id=”txtDOB” runat=”server”/> (…other controls definition…) </myCtl:SuperContainer> I plan to include two panels in my control, one for the header and another one for the body, but as you can see, the key issue is to find a way to ‘divert’ the child controls that are defined in the markup to the body panel, instead of the default parent container. I feel it can be some how simply override (manipulate) the control property, but don’t know how to properly do so. Can any one give some idea about how to implement this ‘SuperContainer’ control? Many thank, Eric

    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

  • dynamically created controls and postback

    - by Mark
    Hi all, I have created dynamic controls (Radiobuttonlists) in an asp.net page (c#). I create them after a button click like this. RadioButtonList rbl = new RadioButtonList(); c2.Controls.Add(rbl); //Set properties of rbl rbl.RepeatLayout = RepeatLayout.Flow; rbl.ID = string.Format("rbl{0}", item.QuestionID); rbl.RepeatDirection = RepeatDirection.Horizontal; rbl.Items.Add(new ListItem("True", "1")); rbl.Items.Add(new ListItem("False", "0")); rbl.Items.Add(new ListItem("?", "-1")); Now the problem arises when I click the submit button, the controls are lost. I know it's better to actually put the controls in page_init event. but is there no workaround so I can still initiate my controls after button click? And is it good to first create button, then add it to control collection and then set its properties? Thankd in advance Kind regards, Mark

    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

  • Are folks using the VB6 "Common Controls Replacement Project" controls? Any caveats or showstoppers?

    - by Clay Nichols
    I'm considering using the VB6 Common Controls Replacement Project controls and would like to see what other's experiences with them are. Specifically: What do you need to distribute with them? (I assume just the .OCX file) Do I need to register the .ocx file or just include in the app directory? Do these controls depend on any other ocx's? (There is mention, for example in the Progress Bar replacement that it is using COMCTL32.DLL but the .DEP file does not list that DLL. Are they at least as robust as the controls they replace?

    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

  • Cellbi Silverlight Controls Giveaway (5 License to give away)

    - by mbcrump
    Cellbi recently updated their new Silverlight Controls to version 4 and to support Visual Studio 2010. I played with a couple of demos on their site and had to take a look. I headed over to their website and downloaded the controls. The first thing that I noticed was all of the special text effects and animations included. I emailed them asking if I could give away their controls in my January 2011 giveaway and they said yes. They also volunteered to give away 5 total license so the changes for you to win would increase.  I am very thankful they were willing to help the Silverlight community with this giveaway. So some quick rules below: ----------------------------------------------------------------------------------------------------------------------------------------------------------- Win a FREE developer’s license of Cellbi Silverlight Controls! (5 License to give away) Random winner will be announced on February 1st, 2011! To be entered into the contest do the following things: Subscribe to my feed. Leave a comment below with a valid email account (I WILL NOT share this info with anyone.) Retweet the following : I just entered to win free #Silverlight controls from @mbcrump and @cellbi http://mcrump.me/cscfree ! Don’t change the URL because this will allow me to track the users that Tweet this page. Don’t forget to visit Cellbi because they made this possible. ---------------------------------------------------------------------------------------------------------------------------------------------------------- Before we get started with the Silverlight Controls, here is a couple of links to bookmark: The What's new in this release page is here. You can also check out the live demos here. Don’t worry about the Samples/Help Documentation. That is installed to your local HDD during the installation process. Begin by downloading the trial version and running the program. After everything is installed then you will see the following screen: After it is installed, you may want to take a look at your Toolbox in Visual Studio 2010. After you add the controls from the “Choose Items” in Silverlight and you will see that you now have access to all of these controls. At this point, to use the controls it’s as simple as drag/drop onto your Silverlight container. It will create the proper Namespaces for you. It’s hard to show with a static screenshot just how powerful the controls actually are so I will refer you to the demo page to learn more about them. Since all of these are animations/effects it just doesn’t work with a static screenshot. It is worth noting that the Sfx pack really focuses on the following core effects: I will show you the best route to get started building a new project with them below. The best page to start is the sample browser which you can access by going to SvFx Launcher. In my case, I want to build a new Carousel. I simple navigate to the Carousel that I want to build and hit the “Cs” code at the top. This launches Visual Studio 2010 and now I can copy/paste the XAML into my project. That is all there is to it. Hopefully this post was helpful and don’t forget to leave a comment below in order to win a set of the controls!  Subscribe to my feed

    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

  • serverside controls vs html controls from AJAX point of view

    - by devmania
    hi, i know this question have been mentioned alot here but mine is a little more updated, now with ASP.net 4 and new Ajax client templating plus JASON services. so if i got all these new capabilities will i really need server side controls as long as i can bind on client side, create data-views on client side heck i can even use data-context and apply CRUD operations on clients side. so i actually i wont need button_click server side event or what so ever... i am asking this because i own some commercial Controls like Telerik and Component art and they both offer client side operations ow but still i am confused as to my knowledge creating these controls will still have to go through Page Life cycle please advise me.

    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

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