Search Results

Search found 2674 results on 107 pages for 'validate'.

Page 19/107 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Why is this jquery dialog window not displaying?

    - by user338413
    I've got a form that is using jquery validation. When the user clicks the submit button, I've got some jquery that intercepts the submit and should display a dialog window asking the user to verify the information they entered on the form. This dialog window should only display if the form has validated. Here is my code: $('#form').submit(function(){ fillVerificationDialog(); /* This loads up the dialog with form data */ if (('#form').valid()){ $('verification_dialog').dialog('open'); return false; } }); My dialog window is not displaying. It just submits the form. And I've verified that the form is valid by using an alert that checks the value of $('#form').valid() If I remove the if statement and just have the line that opens the dialog, the dialog displays. However, it will display even if the form has errors which is what I'm trying to prevent.

    Read the article

  • jQuery validation plugin - no error messages instead custom backgrounds

    - by Skoota
    I am using the jQuery validation plugin. The form which is being validated has custom background images for the text input fields, so instead of showing an error message for invalid fields I would like to change the background image. Making things a bit trickier is that the background image for the fields is on a different div absolutely positioned behind the text field (which has a transparent background and no border). I will spare going into the reasons for this design decision here (it's related to margins within the text field) but I thought it should be mentioned since it is critical to this question. Therefore, I have two questions: How can I stop the display of the error messages all-together? How can I instead tell the validation plugin if, for example, the name field (e.g. <input id=name ... />) is invalid then it should change the background for the relevant div (e.g. <div id=name-bg... ></div>)? Thanks for any assistance!

    Read the article

  • Rails group validation with just one error message

    - by Victor
    The following validation code in the model: validates :formatted_address, :zip, :city, :state, :country, :presence => true, :message => "is incomplete. Please enter full address." is displayed when either of the fields are empty. Let's say now :address and country are empty, 2 errors are displayed: Formatted Address is incomplete. Please enter full address. Country is incomplete. Please enter full address. How can I group the error message in the validation to just show one error message if either of the fields validated does not exist? Address is incomplete. Please enter full address. Thanks.

    Read the article

  • Image change on mouseover with jQuery..

    - by playahabana
    Hi, I am a comlete beginner to pretty much all things web design and am trying to construct my first website. I am attempting to hand code it without the ue of a CMS in order to learn as much as possible as quickly as possible. I am trying to make an imge change on mouseover for my top nav menu, and have the following jQuery functions: $(document).ready(function(){ $(".navlist img").each(function) { rollsrc = $(this).attr("src"); rollON = rollsrc.replace(/.jpg$/ig,"_link.png"); $("<img>").attr("src",rollON); $(".navlist a").mouseover(function(){ }); imgsrc= $(this).children("img").attr("src"); matches = imgsrc.match(/_link.png); if (!matches) { imgsrcON = imgsrc.replace(/.jpg$/ig,"_link.png"); $(this).children("img").attr("src", imagesrcON); } $(".navlist a").mouseout(function(){ $(this).children("img").attr("src", imgsrc); }); }); my html is as follows: <div id="nav"> <ul class="navmenu"> <li><a href="index.html"><img class="swap" src="images/links/home.jpg" alt="Home" border="none"></a></li> <li><a href="#"><img class="swap" src="images/links/ourbar.jpg" alt="Our Bar" border="none"></a> <ul class="navdrop"> <li ><a href="#"><img class="swap" src="images/links/cockteles.jpg" alt="Our Cocktails" border="none"></a></li> <li ><a href="#"><img class="swap" src="images/links/celebrate.jpg" alt="Celebrate in Style" border="none"></a></li> </ul> </li> <li><a href="#"><img class="swap" src="images/links/ourcigars.jpg" alt="Our Cigars" border="none"></a> <ul class="navdrop"> <li><a href="#"><img class="swap" src="images/links/edicionlimitadas.jpg" alt="Edition Limitadas" border="none"></a></li> <li><a href="our_cigars.html"><img class="swap" src="images/links/cigartasting.jpg" alt="Cigar Tastings" border="none"></a></li> </ul> </li> <li><a href="#"><img class="swap" src="images/links/personalcigar.jpg" alt="Personal Cigar Roller" border="none"></a></li> <li><a href="our_cigars.html"><img class="swap" src="images/links/photogallery.jpg" alt="Photo Gallery" border="none"></a></li> <li><a href="#"><img class="swap" src="images/links/contactus.jpg" alt="Contact Us" border="none"></a></li> </ul></div></div><!--end banner--> the image src for the alt image is in the form eg."images/links/home_link.png" and is the same for every image. I have checked this and checked this, could some body please give me a pointer as to where I am going wrong? Or a pointer to a tutorial for this effect? I have looked at a few and this seems to be the best for what I am attempting, but as I said I don't really know what I'm doing so any advice gratefully received.....

    Read the article

  • Recommended place for pre-translated Zend Framework resources

    - by Exception e
    Since zf 1.10 Zend Framework ships with pre-translated validation messages. They are outside the library path. The manual illustrates how to load these in your bootstrap. $translator = new Zend_Translate( 'array', '/resources/languages', $language, array('scan' => Zend_Locale::LOCALE_DIRECTORY) ); Zend_Validate_Abstract::setDefaultTranslator($translator); I am inclined to think that these resources are specific to the zf-version; validators could change over time. If i copy the resources to my application tree I need to perform additional maintenance each time I upgrade to a newer version. What is best practice? Is there a ZF convention already?

    Read the article

  • Toggle alternative

    - by Nutmeg
    In a contactform I am using both the jQuery validation plug-in 1.3 and the following (slide) script: $(document).ready(function() { // Expand Panel $("#open").click(function(){ $("div#contact").slideDown("slow"); }); // Collapse Panel $("#close").click(function(){ $("div#contact").slideUp("bounce"); }); // Switch buttons from "Log In | Register" to "Close Panel" on click $("#toggle a").click(function () { $("#toggle a").toggle(); }); }); Problem is that the validation plug-in 1.3 uses the following segment: addWrapper:function(toToggle){if(this.settings.wrapper)toToggle.push(toToggle.parents(this.settings.wrapper));return toToggle;}, which conflicts with the slide code. What's the smartest way to go about this? Using the toggleClass instead? Thanks for your help!

    Read the article

  • JQuery form validator that is W3C Valid

    - by Rudiger
    Im doing some form validation on a website and I've tried to use JQuery Validator and it works find but isn't valid as it uses custom attributes. I've tried every which way to make it valid but it seems besides some other custom javascript, which is not an option, it isn't valid. Has anyone come across one that is valid? Or some other way to make it valid? I've tried custom dtds, adding the attribute to the doctype but that leaves a ] on the page. Cheers

    Read the article

  • Working with Jquery. How to change css class of an element in same root

    - by Shantanu Gupta
    I want to change css class of an element on certain event in jquery. eg. focusin: function() { if(this.val()=="First Name") $(this).find("span ").css } $(this).find("span which contains _set").class= mycssclass here I want to change the CSS class of span element whose id contains "_set" as a part of substring in class name and also want to change the text i.e. InnerHtml property of javascript of this span element

    Read the article

  • How do I specify the regular expression to disable the use of underscores after the '@' sign in php for email validation?

    - by Qlidnaque
    Currently the following email in the script validates even though there are no underscores indicated in the second part of the regular expression validation after the '@' sign. How do I make underscores invalid in the second part of the email? <?php $email = 'firstname.lastname@a_aa.bbb.co_m'; $regexp = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9]+([.][A-z0-9]+)*[.][A-z]{2,4}$/"; if (preg_match($regexp, $email)) { echo "Email address is valid."; } else { echo "Email address is <u>not</u> valid."; } ?>

    Read the article

  • how to combine the error message from jquery validation

    - by aon
    how to combine the error message from jquery validation. for example: messages: { first_name: { required: "Please enter your first name." }, email: { required: "Please enter a valid email address.", remote: "Email has been registered." }, username: { required: "Please enter username.", remote: "Username has been registered." } }, Desired message will be like this: Please enter your first name, a valid email address and username or Please enter your first name and username, email has been registered etc.

    Read the article

  • Why does false invalidate validates_presence_of?

    - by DJTripleThreat
    Ok steps to reproduce this: prompt> rails test_app prompt> cd test_app prompt> script/generate model event_service published:boolean then go into the migration and add not null and default published to false: class CreateEventServices < ActiveRecord::Migration def self.up create_table :event_services do |t| t.boolean :published, :null => false, :default => false t.timestamps end end def self.down drop_table :event_services end end now migrate your changes and run your tests: prompt>rake db:migrate prompt>rake You should get no errors at this time. Now edit the model so that you validate_presence_of published: class EventService < ActiveRecord::Base validates_presence_of :published end Now edit the unit test event_service_test.rb: require 'test_helper' class EventServiceTest < ActiveSupport::TestCase test "the truth" do e = EventServer.new e.published = false assert e.valid? end end and run rake: prompt>rake You will get an error in the test. Now set e.published to true and rerun the test. IT WORKS! I think this probably has something to do with the field being boolean but I can't figure it out. Is this a bug in rails? or am I doing something wrong?

    Read the article

  • Validating entered user data

    - by msfanboy
    Hello, this is a general question but I do a desktop application. Should I check for example the firstname exceeding 50 chars or is this a matter of taste? Or should I check for 50 chars because the user could flood my database with 10000000 chars ?

    Read the article

  • Add a custom jquery validation method not connected to a field

    - by Johan Wikström
    Normally all validation methods is connected to a field, radiobuttons, dropdowns etc. In my case I would like to do a general custom validation that depends on many fields in my form. I dont want one field of them to become highlighted like a normal "required", i would rather just show a message in the errorcontainer. Is there a simple way to do this I have overlooked?

    Read the article

  • Using jquery to disable function untill all selects are changed

    - by richbyte
    I am using a javascript function (F) (jquery )which uses 3 select values selected by the user to calculates a value - R(result) R is a number ranging from (1 through 9), (11) and (22); I need 2 extra steps one before the calculation and one after. a. Before calculation takes place: Make sure all three select values are changed before function(F) takes place. If not prompt the user with a notice ( create dom element/ I am using jquery) b. After the value R is calculated show an element corresponding to the result e.g. if R is 1 show an element ( a predetermined "link" element corresponding to each result value) thanks a lot.

    Read the article

  • JQuery validation using is() and multiple CSS classes

    - by Alex
    Hi Folks, Trying to debug something that basically .trim()'s, .val()'s and .length's a textarea input as HTML below (truncated): <form id="Kontaktanfrage" method="post" action="tests/testform/"> ... <textarea cols="50" rows="8" id="el_12" name="FORM[Kontaktanfrage][el_12]" title="Ihre Nachricht: *" class="textarea required"></textarea> ... </form> JavaScript: function validateField(formId, fieldId) { if (fieldId) { var element = "form#"+formId+" input#"+fieldId; var fieldValue = jQuery.trim(jQuery(element).val()); var fieldLength = fieldValue.length; var fieldError = ""; if ($(element).is('.textarea.required') && fieldLength == 0) { fieldError = "error message"; } } } The above if check is never true. Using JQuery: 1.4.1. Having seen other examples online, I can't see what the difference should be. Feel free to test it in FireBug at (http://www.initiat.de/tests/testform/). Any help appreciated, can't see what I'm doing wrong.

    Read the article

  • Effective Data Validation

    - by John Conde
    What's an effective way to handle data validation, say, from a form submission? Originally I had a bunch of if statements that checked each value and collected invalid values in an array for later retrieval (and listing). // Store errors here $errors = array(); // Hypothetical check if a string is alphanumeric if (!preg_match('/^[a-z\d]+$/i', $fieldvalue)) { $errors[$fieldname] = 'Please only use letters and numbers for your street address'; } // etc... What I did next was create a class that handles various data validation scenarios and store the results in an internal array. After data validation was complete I would check to see if any errors occurred and handle accordingly: class Validation { private $errorList = array(); public function isAlphaNumeric($string, $field, $msg = '') { if (!preg_match('/^[a-z\d]+$/i', $string)) { $this->errorList[$field] = $msg; } } // more methods here public function creditCard($cardNumber, $field, $msg = '') { // Validate credit card number } // more methods here public function hasErrors() { return count($this->errorList); } } /* Client code */ $validate = new Validation(); $validate->isAlphaNumeric($fieldvalue1, $fieldname1, 'Please only use letters and numbers for your street address'); $validate->creditCard($fieldvalue2, $fieldname2, 'Please enter a valid credit card number'); if ($validate->hasErrors()) { // Handle as appropriate } Naturally it didn't take long before this class became bloated with the virtually unlimited types of data to be validated. What I'm doing now is using decorators to separate the different types of data into their own classes and call them only when needed leaving generic validations (i.e. isAlphaNumeric()) in the base class: class Validation { private $errorList = array(); public function isAlphaNumeric($string, $field, $msg = '') { if (!preg_match('/^[a-z\d]+$/i', $string)) { $this->errorList[$field] = $msg; } } // more generic methods here public function setError($field, $msg = '') { $this->errorList[$field] = $msg; } public function hasErrors() { return count($this->errorList); } } class ValidationCreditCard { protected $validate; public function __construct(Validation $validate) { $this->validate = $validate; } public function creditCard($cardNumber, $field, $msg = '') { // Do validation // ... // if there is an error $this->validate->setError($field, $msg); } // more methods here } /* Client code */ $validate = new Validation(); $validate->isAlphaNumeric($fieldvalue, $fieldname, 'Please only use letters and numbers for your street address'); $validateCC = new ValidationCreditCard($validate); $validateCC->creditCard($fieldvalue2, $fieldname2, 'Please enter a valid credit card number'); if ($validate->hasErrors()) { // Handle as appropriate } Am I on the right track? Or did I just complicate data validation more then I needed to?

    Read the article

  • Should I use a unit testing framework to validate XML documents?

    - by christofr
    From http://www.w3.org/XML/Schema: [XML Schemas] provide a means for defining the structure, content and semantics of XML documents. I'm using an XML Schema (XSD) to validate several large XML documents. While I'm finding plenty of support within XSD for checking the structure of my documents, there are no procedural if/else features that allow me to say, for instance, If Country is USA, then Zipcode cannot be empty. I'm comfortable using unit testing frameworks, and could quite happily use a framework to test content integrity. Am I asking for trouble doing it this way, rather than an alternative approach? Has anybody tried this with good / bad results? -- Edit: I didn't include this information to keep it technology agnostic, but I would be using C# / Linq / xUnit for deserialization / testing.

    Read the article

  • How can I validate if a 13.10 update was complete?

    - by James
    I attempted to upgrade Ubuntu 13.04 server to 13.10 tonight via the standard linux text console and it had some trouble. Machine boots and displays 13.10, but I am unsure exactly what or how much was successfully upgraded. Is there some command I can run which will validate that all system has all standard binaries upgraded to the 13.10 release? As for the issue .... everything seemed to be going along ok until the screen displayed some kind of menu option regarding local edits to samba config file. There was a prompt requesting root password or ctrl-d to continue, but it would not take any input. From another terminal screen I tried killing the process displaying this samba message, and then some screen/SCREEN processes. The hard drive activity picked up for a while and then all the processes on that pty were gone. As I said, reboot was OK, but I have no idea if everything was upgraded. The machine seems to be acting like normal, except that the upgrade killed my openpvn process which I'll need to reload. Thanks

    Read the article

  • jquery form validate not allow space for username field?

    - by python
    I have used http://bassistance.de/jquery-plugins/jquery-plugin-validation/ my form validate : $("#form_person").validate({ rules: { username: { required: true, minlength: 2, maxlength:15 }, password: { required: true, minlength: 2 }, confirm_password: { required: true, minlength: 2, equalTo: "#password" }, email: { required: true, email: true } }, messages: { username: { required: "Please enter a username", maxlength:"max length 15 digits", minlength: "Your username must consist of at least 2 characters" }, password: { required: "Please provide a password", minlength: "Your password must be at least 5 characters long" }, confirm_password: { required: "Please provide a confirm password", minlength: "Your password must be at least 5 characters long", equalTo: "Please enter the same password as above" } }); Anybody help me to validate not allow space on username? thanks

    Read the article

  • ASP.NET: What's the best way to validate 3 drop downs boxes that are used to select a date (month, d

    - by Josh
    I have two sets of drop downs for start date and end date. Each date is created by selecting a month, day, and year from 3 separate drop downs. I currently have RequiredFieldValidators on all the drop downs (which just shows a * if nothing has been selected yet), but I need to validate that the end date is greater than the start date. I can take care of the logic behind comparing the dates, but in terms of the validation method used, can someone help me out (I essentially need to validate 6 drop downs all at one time)? I tried a custom validation using client side javascript but couldn't get it to work. Can you even validate multiple drop downs using ASP.NET validation controls? (which is what I would like to do - I can always write the javascript, but was trying to stay away from this). Thanks.

    Read the article

  • How to Validate an XML Node against an XSD in C++?

    - by Ashish
    Hi Please note that I'm asking for validation against a particular node and not the whole file. For examples <somexmldoc> <someNode> <UserDefinedNode> </> <UserDefinedNode> </> </someNode> </somexmldoc> For this XML doc, I have an wholeDoc.XSD which could be used to validate the whole document except "UserDefinedNode" (This node is specified with "any" tag in xsd, which allows a user to define anything under that node). Is it possible to have a separate userdefined.XSD file to validate "UserDefinedNode"? Is it possible to use MSXML for C++ (IXMLDomDocument) to validate this? Thanks!

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >