Search Results

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

Page 13/107 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Active Directory validate service account and user accounts

    - by Padur
    Hello folks I have an issue here, I guess you all know what is AD service account and why it is used for, if not please see the below description ? SSL-Explorer requires a dedicated Active Directory account to use for authenticating AD users. This account serves as a link to your Active Directory database. If the Service Account is not found on your AD database then the SSL-Explorer service will not start. Well I have Active Directory service account details and user submitted login/password details.In the code below I validated service account by giving MEMBER_GRPUP and adminPassword and I check whether the user exists in Active Directory by submitting samaaccountname but my question here is how do I validate the password submitted for that user? I am not sure how to do this, I appreciate if anybody has any suggestions on this. Thanks for your time. public boolean validateUserFromActiveDirectory(String userId) { final String MEMBER_GROUP = "CN=asdadasd,OU=asdasdasd Accounts,OU=adasdas,OU=asdasdas,DC=asdasdas,DC=asdasdas,DC=adasdasd,DC=asdasdasd"; String employeeNumber = ""; final String LDAP_INIT_CTX = "com.sun.jndi.ldap.LdapCtxFactory"; final String LDAP_URL = "ldap://xx-ssssssss.eee.eee.eeeee.eeeee:636"; final String MY_ATTRS[] = { "employeeNumber" }; String adminPassword = "somepassword"; String securityProtocol = "ssl"; boolean isValidUser = false; try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, LDAP_INIT_CTX); env.put(Context.PROVIDER_URL, LDAP_URL); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.REFERRAL, "follow"); env.put(Context.SECURITY_PRINCIPAL, MEMBER_GROUP); env.put(Context.SECURITY_CREDENTIALS, adminPassword); env.put(Context.SECURITY_PROTOCOL, securityProtocol); //C:\Documents and Settings\yourusername\Local Settings\Temp File tf = File.createTempFile("adentTruststore", ".jks"); tf.deleteOnExit(); byte buffer[] = new byte[0x1000]; ClassLoader cl = JNDI.class.getClassLoader(); InputStream in = cl.getResourceAsStream( "someTruststore.jks"); FileOutputStream out = new FileOutputStream(tf); int cnt; while ((cnt = in.read(buffer)) != -1) out.write(buffer, 0, cnt); in.close(); out.close(); System.setProperty("javax.net.ssl.trustStore", tf .getAbsolutePath()); DirContext context = new InitialLdapContext(env, null); SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); NamingEnumeration results = context.search( "XX=ent,XX=abc,XX=aaaaa,XX=aaaa", "(sAMAccountName=" + userId + ")", searchControls); if (results != null && results.hasMore()) { //some logic } } } catch (Exception e) { e.printStackTrace(); } return isValidUser; }

    Read the article

  • dbms_xmlschema fail to validate with complexType

    - by Andrew
    Preface: This works on one Oracle 11gR1 (Solaris 64) database and not on a second and we can't figure out the difference between the two databases. Somehow the complexType causes the validation to fail with this error: ORA-31154: invalid XML document ORA-19202: Error occurred in XML processing LSX-00200: element "shiporder" not empty ORA-06512: at "SYS.XMLTYPE", line 354 ORA-06512: at line 13 But the schema is valid (passes this online test: http://www.xmlme.com/Validator.aspx) -- Cleanup any existing schema begin dbms_xmlschema.deleteschema('shiporder.xsd',dbms_xmlschema.DELETE_CASCADE); end; -- Define the problem schema (adapted from http://www.w3schools.com/schema/schema_example.asp) begin dbms_xmlschema.registerSchema('shiporder.xsd','<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="shiporder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>',owner=>'SCOTT'); end; -- Attempt to validate declare bbb xmltype; begin bbb := XMLType('<?xml version="1.0" encoding="ISO-8859-1"?> <shiporder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="shiporder.xsd"> <orderperson>John Smith</orderperson> </shiporder>'); XMLType.schemaValidate(bbb); end; Now if I gut the schema definition and leave only a string in the XML then the validation passes: begin dbms_xmlschema.deleteschema('shiporder.xsd',dbms_xmlschema.DELETE_CASCADE); end; begin dbms_xmlschema.registerSchema('shiporder.xsd','<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="shiporder" type="xs:string"/> </xs:schema>',owner=>'SCOTT'); end; DECLARE xml XMLTYPE; BEGIN xml := XMLTYPE('<?xml version="1.0" encoding="ISO-8859-1"?> <shiporder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="shiporder.xsd"> John Smith </shiporder>'); XMLTYPE.schemaValidate(xml); END;

    Read the article

  • How to associate jquery validation with only one button if there are many?

    - by Eyla
    Greetings, In my current project, I have gridview, search button, text box for search, text box, and submit button. -I should input string in the search box then click search button. -when click search button, it will retrieve all matches records then bind them to the view grid. -then when I click a record in the gridview, it should bound a field to the second text box. finally I should submit the page by clicking in submit button. where is the problem: -the problme that I'm using jquery validation plugin that will make second text box is required. -when I click search button will not allow postback until I write some thing in second text box. How can I make scond text box only do validation for required field only when click asp.net submit button. here is my code: <%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="IMAM_APPLICATION.WebForm1" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <script src="js/jquery-1.4.1-vsdoc.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script src="js/js.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ // debug: true, rules: { "<%=txtFirstName.UniqueID %>": { required: true } }, errorElement: "mydiv", wrapper: "mydiv", // a wrapper around the error message errorPlacement: function(error, element) { offset = element.offset(); error.insertBefore(element) error.addClass('message'); // add a class to the wrapper error.css('position', 'absolute'); error.css('left', offset.left + element.outerWidth()); error.css('top', offset.top - (element.height() / 2)); } }); }) </script> <div id="mydiv"> <asp:GridView ID="GridView1" runat="server" style="position:absolute; top: 280px; left: 30px; height: 240px; width: 915px;" PageSize="5" onselectedindexchanged="GridView1_SelectedIndexChanged" AutoGenerateColumns="False" DataKeyNames="idcontact_info"> <Columns> <asp:CommandField ShowSelectButton="True" InsertVisible="False" ShowCancelButton="False" /> <asp:BoundField DataField="First_Name" HeaderText="First Name" /> <asp:BoundField AccessibleHeaderText="Midle Name" DataField="Midle_Name" /> <asp:BoundField DataField="Last_Name" HeaderText="Last Name" /> <asp:BoundField DataField="Phone_home" HeaderText="Phone Home" /> <asp:BoundField DataField="cell_home" HeaderText="Mobile Home" /> <asp:BoundField DataField="phone_work" HeaderText="Phone Work" /> <asp:BoundField DataField="cell_Work" HeaderText="Mobile Work" /> <asp:BoundField DataField="Email_Home" HeaderText="Personal Home" /> <asp:BoundField DataField="Email_work" HeaderText="Work Email" /> </Columns> </asp:GridView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="IMAM_APPLICATION.DSContactTableAdapters.contact_infoTableAdapter" UpdateMethod="Update"> <DeleteParameters> <asp:Parameter Name="Original_idcontact_info" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="First_Name" Type="String" /> <asp:Parameter Name="Midle_Name" Type="String" /> <asp:Parameter Name="Last_Name" Type="String" /> <asp:Parameter Name="Address1_Home" Type="String" /> <asp:Parameter Name="Address2_Home" Type="String" /> <asp:Parameter Name="City_Home" Type="String" /> <asp:Parameter Name="State_Home" Type="String" /> <asp:Parameter Name="Prov_Home" Type="String" /> <asp:Parameter Name="ZipCode_Home" Type="String" /> <asp:Parameter Name="Country_Home" Type="String" /> <asp:Parameter Name="Phone_home" Type="String" /> <asp:Parameter Name="Phone_Home_Ext" Type="String" /> <asp:Parameter Name="Cell_home" Type="String" /> <asp:Parameter Name="Fax_home" Type="String" /> <asp:Parameter Name="Email_Home" Type="String" /> <asp:Parameter Name="material_status" Type="String" /> <asp:Parameter Name="DateOfBrith" Type="String" /> <asp:Parameter Name="company" Type="String" /> <asp:Parameter Name="Work_Field" Type="String" /> <asp:Parameter Name="Occupation" Type="String" /> <asp:Parameter Name="sub_Occupation" Type="String" /> <asp:Parameter Name="Other" Type="String" /> <asp:Parameter Name="Address1_work" Type="String" /> <asp:Parameter Name="Address2_work" Type="String" /> <asp:Parameter Name="City_Work" Type="String" /> <asp:Parameter Name="State_Work" Type="String" /> <asp:Parameter Name="Prov_Work" Type="String" /> <asp:Parameter Name="ZipCode_Work" Type="String" /> <asp:Parameter Name="Country_Work" Type="String" /> <asp:Parameter Name="Phone_Work" Type="String" /> <asp:Parameter Name="Phone_Work_Ext" Type="String" /> <asp:Parameter Name="Cell_Work" Type="String" /> <asp:Parameter Name="Fax_Work" Type="String" /> <asp:Parameter Name="Email_work" Type="String" /> <asp:Parameter Name="WebSite" Type="String" /> <asp:Parameter Name="Note" Type="String" /> <asp:Parameter Name="Groups" Type="String" /> <asp:Parameter Name="InterPhoneHome" Type="Int32" /> <asp:Parameter Name="InterMobileHome" Type="Int32" /> <asp:Parameter Name="InterFaxHome" Type="Int32" /> <asp:Parameter Name="InterPhoneWork" Type="Int32" /> <asp:Parameter Name="InterMobileWork" Type="Int32" /> <asp:Parameter Name="InterFaxWork" Type="Int32" /> <asp:Parameter Name="rdoPhoneHome" Type="Int32" /> <asp:Parameter Name="rdoMobileHome" Type="Int32" /> <asp:Parameter Name="rdoEmailHome" Type="Int32" /> <asp:Parameter Name="rdoPhoneWork" Type="Int32" /> <asp:Parameter Name="rdoMobileWork" Type="Int32" /> <asp:Parameter Name="rdoEmailWork" Type="Int32" /> <asp:Parameter Name="locationHome" Type="Int32" /> <asp:Parameter Name="locationWork" Type="Int32" /> <asp:Parameter Name="Original_idcontact_info" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="First_Name" Type="String" /> <asp:Parameter Name="Midle_Name" Type="String" /> <asp:Parameter Name="Last_Name" Type="String" /> <asp:Parameter Name="Address1_Home" Type="String" /> <asp:Parameter Name="Address2_Home" Type="String" /> <asp:Parameter Name="City_Home" Type="String" /> <asp:Parameter Name="State_Home" Type="String" /> <asp:Parameter Name="Prov_Home" Type="String" /> <asp:Parameter Name="ZipCode_Home" Type="String" /> <asp:Parameter Name="Country_Home" Type="String" /> <asp:Parameter Name="Phone_home" Type="String" /> <asp:Parameter Name="Phone_Home_Ext" Type="String" /> <asp:Parameter Name="Cell_home" Type="String" /> <asp:Parameter Name="Fax_home" Type="String" /> <asp:Parameter Name="Email_Home" Type="String" /> <asp:Parameter Name="material_status" Type="String" /> <asp:Parameter Name="DateOfBrith" Type="String" /> <asp:Parameter Name="company" Type="String" /> <asp:Parameter Name="Work_Field" Type="String" /> <asp:Parameter Name="Occupation" Type="String" /> <asp:Parameter Name="sub_Occupation" Type="String" /> <asp:Parameter Name="Other" Type="String" /> <asp:Parameter Name="Address1_work" Type="String" /> <asp:Parameter Name="Address2_work" Type="String" /> <asp:Parameter Name="City_Work" Type="String" /> <asp:Parameter Name="State_Work" Type="String" /> <asp:Parameter Name="Prov_Work" Type="String" /> <asp:Parameter Name="ZipCode_Work" Type="String" /> <asp:Parameter Name="Country_Work" Type="String" /> <asp:Parameter Name="Phone_Work" Type="String" /> <asp:Parameter Name="Phone_Work_Ext" Type="String" /> <asp:Parameter Name="Cell_Work" Type="String" /> <asp:Parameter Name="Fax_Work" Type="String" /> <asp:Parameter Name="Email_work" Type="String" /> <asp:Parameter Name="WebSite" Type="String" /> <asp:Parameter Name="Note" Type="String" /> <asp:Parameter Name="Groups" Type="String" /> <asp:Parameter Name="InterPhoneHome" Type="Int32" /> <asp:Parameter Name="InterMobileHome" Type="Int32" /> <asp:Parameter Name="InterFaxHome" Type="Int32" /> <asp:Parameter Name="InterPhoneWork" Type="Int32" /> <asp:Parameter Name="InterMobileWork" Type="Int32" /> <asp:Parameter Name="InterFaxWork" Type="Int32" /> <asp:Parameter Name="rdoPhoneHome" Type="Int32" /> <asp:Parameter Name="rdoMobileHome" Type="Int32" /> <asp:Parameter Name="rdoEmailHome" Type="Int32" /> <asp:Parameter Name="rdoPhoneWork" Type="Int32" /> <asp:Parameter Name="rdoMobileWork" Type="Int32" /> <asp:Parameter Name="rdoEmailWork" Type="Int32" /> <asp:Parameter Name="locationHome" Type="Int32" /> <asp:Parameter Name="locationWork" Type="Int32" /> </InsertParameters> </asp:ObjectDataSource> <asp:TextBox ID="txtSearch" runat="server" style="position:absolute; top: 560px; left: 170px;" ></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="Search" style="position:absolute; top: 555px; left: 375px;" CausesValidation="False" onclick="btnSearch_Click"/> <asp:Label ID="Label7" runat="server" Style="position: absolute; top: 630px; left: 85px;" Text="First Name"></asp:Label> <asp:TextBox ID="txtFirstName" runat="server" Style="top: 630px; left: 185px; position: absolute; height: 22px; width: 128px"></asp:TextBox> <asp:Button ID="submit" runat="server" Text="submit" /> </div> </asp:Content>

    Read the article

  • Validation Summary with JQuery in MVC 2

    - by Nigel Sampson
    I'm trying to get client validation working on my asp.net mvc 2 web application (Visual Studio 2010). The client side validation IS working. However the validation summary is not. I'm including the following scripts <script type="text/javascript" src="../../content/scripts/jquery-1.4.1.js"></script> <script type="text/javascript" src="../../content/scripts/jquery.validate.js"></script> <script type="text/javascript" src="../../content/scripts/MicrosoftMvcJQueryValidation.js"></script> Have this before this form is started <% Html.EnableClientValidation(); %> and inside the form is <%: Html.ValidationSummary("There are some errors to fix.", new { @class = "warning_box" })%> <p> <%: Html.LabelFor(m => m.Name) %><br /> <%: Html.TextBoxFor(m => m.Name) %> <%: Html.ValidationMessageFor(m => m.Name, "*") %> </p> I have that latest version of MicrosoftMvcJQueryValidation.js from the MvcFutures download, but it doesn't look like it supports Validation Summary. I've tried correcting this by setting extra options such as errorContainer and errorLabelContainer, but it looks like there's some more underlying issues with it. Is there an updated / better version of this file around?

    Read the article

  • jQuery datepicker validation message issue

    - by Abhishek
    Hi, I'm using the jquery datepicker plugin at http://plugins.jquery.com/project/datepick with the datepicker validation plugin. <script id="frmValidation" type="text/javascript"> $(document).ready(function(){ var validator = $("#frmTest").validate({ rules:{ fname: "required", dobPicker: "required" }, messages:{ fname: "Please enter a name", dobPicker: "Select a date" }, }); $('#dobPicker').datepick(); $.datepick.setDefaults({showOn: 'both', dateFormat: 'dd-mm-yy', yearRange:'1900:2010'}); }); </script> And the body of the document is as follows : <form id="frmTest" action="" method="post"> <div id="error-list"></div> <div class="form-row"> <span class="label"><label for="fname">Name</label></span> <input type="text" name="fname" /> </div> <div class="form-row"> <span class="label"><label for="dobPicker">DOB</label></span> <input type="text" id="dobPicker" name="dobPicker" style="margin-left: 4px;"/> </div> <div class="form-row"> <input type="submit" name="submit" value="submit"/> </div> </form> The form validates the first time but the error message for the datepicker does not disappear immediately a date is selected.. however it goes away if the date is selected the second time. Any help to make it go the first time a date is selected will be appreciated

    Read the article

  • jQuery Validation Plugin: Validating Checkboxes with Different Names

    - by Michael
    I have a set of 4 checkboxes, all with different names, and require that at least 1 is checked. I know there are a few posts on here already trying to answer this question. The solution that seems to be most logical to me is the answer posted on Question 1734840, but I can't seem to get it working! What's wrong with my code? Or any other new coding ideas to get this working? I have set the class on all of them to 'require-one'. My jQuery code is $(document).ready(function(){ $("#itemForm").validate({ highlight: function(element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); $(element.form).find("label[for=" + element.name + "]") .addClass("radioerror"); }, unhighlight: function(element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); $(element.form).find("label[for=" + element.name + "]") .removeClass("radioerror"); }, rules: { 'require-one': { required : { depends: function(element) { var allBoxes = $('.require-one'); if (allBoxes.filter(':checked').length == 0) { if (allBoxes.eq(element).length != 0) { return true; } } return false; } } } , }, errorPlacement: function(error, element) { if ( element.is("#other_descrip") ) error.appendTo("#othererror" ); if ( element.is("#itemlist") ) error.appendTo("#itemerror" ); } }); });

    Read the article

  • jquery validator message styling error in IE08 only when customised using errorPlacement function

    - by John Slaytor
    Going back to the errorplacement solution by Nadia (http://stackoverflow.com/questions/860055/jquery-override-default-validation-error-message-display-css-popup-tooltip-like) I have tried it and it works like a charm in Safari and Firefox but causes IE08 to bypass the jqueryvalidator and go straight to the server side validator. My code is this - as soon as I insert 'error element.... it is unstable in IE08. All help much appreciated <script type="text/javascript"> $(document).ready(function() { $("#sampleform").validate({ rules: { dinername: "required", venue: "required", contact: "required", dinertelephone: "required", venuetime: "required", numberdiners: "required", dineremail: { required: true, email: true}, datepicker: { required: true,date: true} }, messages: { dinername: "Your name?", numberdiners: "How many guests?", dinertelephone: "Your mobile?", venue: "Which restaurant?", venuetime: "Your arrival time?", datepicker: "Your booking date?", dineremail: "Please enter a valid email address", }, errorElement: "div", errorPlacement: function(error, element) { element.before(error); offset = element.offset(); error.css('right', offset.right); error.css('right', offset.right - element.outerHeight()); } }); }); </script> <script type="text/javascript"> $(function() { $("#datepicker") .datepicker({minDate: 0, maxDate: '+6M +0D',dateFormat: 'DD, d M yy',onClose: function() {$(this).valid();} }); }); </script> The relevant webpage is http://www.johnslaytor.com.au/nilgiris/forms/bookingform/bookingform.html

    Read the article

  • jQuery Validation: Validating Checkboxes with Different Names

    - by Michael
    I have a set of 4 checkboxes, all with different names, and require that at least 1 is checked. I know there are a few posts on here already trying to answer this question. The solution that seems to be most logical to me is the answer posted on Question 1734840, but I can't seem to get it working! What's wrong with my code? Or any other new coding ideas to get this working? I have set the class on all of them to 'require-one'. My jQuery code is $(document).ready(function(){ $("#itemForm").validate({ highlight: function(element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); $(element.form).find("label[for=" + element.name + "]") .addClass("radioerror"); }, unhighlight: function(element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); $(element.form).find("label[for=" + element.name + "]") .removeClass("radioerror"); }, rules: { 'require-one': { required : { depends: function(element) { var allBoxes = $('.require-one'); if (allBoxes.filter(':checked').length == 0) { if (allBoxes.eq(element).length != 0) { return true; } } return false; } } } , }, errorPlacement: function(error, element) { if ( element.is("#other_descrip") ) error.appendTo("#othererror" ); if ( element.is("#itemlist") ) error.appendTo("#itemerror" ); } }); });

    Read the article

  • Check on every page to ensure user has validated as being over 18

    - by liquilife
    Hi Guys and Girls. I'm working on a website (tobacco related) that requires all visitors to validate they are over 18 before they can view the site. I have a form in place that validates the age but I'm at a dead end. How can I use this to store a cookie that they've passed the test and do a check on all pages to see if this check has already been passed or not? Any suggestions and help would be hugely appreciated! Below is my validation form: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Validate</title> <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script> <script language="javascript"> function checkAge() { var min_age = 18; var year = parseInt(document.forms["age_form"]["year"].value); var month = parseInt(document.forms["age_form"]["month"].value) - 1; var day = parseInt(document.forms["age_form"]["day"].value); var theirDate = new Date((year + min_age), month, day); var today = new Date; if ( (today.getTime() - theirDate.getTime()) < 0) { alert("You are too young to enter this site!"); return false; } else { return true; } } </script> </head> <body> <form action="index.html" name="age_form" method="get" id="age_form"> <select name="day" id="day"> <option value="0" selected>DAY</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select name="month" id="month"> <option value="0" selected>MONTH</option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> <select name="year" id="year"> <option value="0" selected>YEAR</option> <option value="1920">1920</option> <option value="1921">1921</option> <option value="1922">1922</option> <option value="1923">1923</option> <option value="1924">1924</option> <option value="1925">1925</option> <option value="1926">1926</option> <option value="1927">1927</option> <option value="1928">1928</option> <option value="1929">1929</option> <option value="1930">1930</option> <option value="1931">1931</option> <option value="1932">1932</option> <option value="1933">1933</option> <option value="1934">1934</option> <option value="1935">1935</option> <option value="1936">1936</option> <option value="1937">1937</option> <option value="1938">1938</option> <option value="1939">1939</option> <option value="1940">1940</option> <option value="1941">1941</option> <option value="1942">1942</option> <option value="1943">1943</option> <option value="1944">1944</option> <option value="1945">1945</option> <option value="1946">1946</option> <option value="1947">1947</option> <option value="1948">1948</option> <option value="1949">1949</option> <option value="1950">1950</option> <option value="1951">1951</option> <option value="1952">1952</option> <option value="1953">1953</option> <option value="1954">1954</option> <option value="1955">1955</option> <option value="1956">1956</option> <option value="1957">1957</option> <option value="1958">1958</option> <option value="1959">1959</option> <option value="1960">1960</option> <option value="1961">1961</option> <option value="1962">1962</option> <option value="1963">1963</option> <option value="1964">1964</option> <option value="1965">1965</option> <option value="1966">1966</option> <option value="1967">1967</option> <option value="1968">1968</option> <option value="1969">1969</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> </select> </form> </body> </html>

    Read the article

  • Combining the jquery Calendar picker with the jquery validation and getting them to play nice?

    - by MBonig
    I'm just starting to get into jquery/javascript programming so this may be a beginner question but I sure can't seem to find anything about it. I have a text field on a form. I've used the JQuery UI Calendar picker to make data entry better. I've also added jquery validation to ensure that if the user enters the date by hand that it's still valid. Here is the html: <input class="datepicker" id="Log_ServiceStartTime_date" name="Log_ServiceStartTime_date" type="text" value="3/16/2010"></input> and javascript: $('form').validate(); $('#Log_ServiceStartTime_date').rules('add','required'); $('#Log_ServiceStartTime_date').rules('add','date'); the problem I'm having is this: If a user puts in a bad date, or no date at all, the validation correctly kicks in and the error description displays. However, if the user clicks on the textbox to bring up the calendar picker and selects a date, the date fills into the field but the validation does not go away. If the user clicks into the textbox and then back out, the validation correctly goes away. How can I get the calendar picker to kick off the validation routine once a date is selected? thanks

    Read the article

  • jQuery Validation Plugin ErrorPlacement inside two different elements

    - by Andy Poquette
    I'm trying to place separate error messages in separate elements when validating a large form. The form is divided into jQueryUI tabs, then accordions. When there is an error in an element of a tab, I want to append a red exclamation point to the name of the tab, and if the error is in an accordion element, I also want to append the red exclamation point to the name of the accordion element. Subsequently, when the errors are corrected, I would like those red ! to be removed (exactly as the error message beneath the invalid field is removed. So: Tab1 Tab2 Accordion1 Accordion2 Tab3 If the elements in accordion 2 have an error, I want to append a red ! to accordion2 and tab2: Tab1 Tab2! Accordion1 Accordion2! Tab3 Then remove when the elements successfully validate. I've been trying forever, but I can't figure out how to conditionally change the errorElement (a label won't work for the tab and accordion, but is perfect for the actual element)... Hopefully this makes sense, and thanks for any input you can provide.

    Read the article

  • jQuery validation required( dependency-expression ) only 1 input validating

    - by user331884
    <script type="text/javascript"> $(function () { $("#form1").validate(); $("#survey1 .response").rules("add", { required: function () { return $('#choices').val() != '' } }); }); </script> <form id="form1" runat="server"> <div id="survey1"> <asp:DropDownList ID="choices" runat="server"> <asp:ListItem Value="">--Select--</asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> </asp:DropDownList> <hr /> Response 1<br /> <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="6" CssClass="response"></asp:TextBox> <hr /> Response 2<br /> <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Rows="6" CssClass="response"></asp:TextBox> </div></form> Only the first textbox gets validated. Am I missing something?

    Read the article

  • jQuery validation plugin: valid() does not work with remote validation ?

    - by a-dilla
    I got started by following this awesome tutorial, but wanted to do the validation on on keyup and place my errors somewhere else. The remote validation shows its own error message at the appropriate times, making me think I had it working. But if I ask specifically if a field with remote validation is valid, it says no, actually, its not. In application.js I have this... $("#new_user").validate({ rules: { "user[login]": {required: true, minlength: 3, remote: "/live_validations/check_login"}, }, messages: { "user[login]": {required: " ", minlength: " ", remote: " "}, } }); $("#user_login").keyup(function(){ if($(this).valid()){ $(this).siblings(".feedback").html("0"); }else{ $(this).siblings(".feedback").html("1"); } }) And then this in the rails app... def check_login @user = User.find_by_login(params[:user][:login]) respond_to do |format| format.json { render :json => @user ? "false" : "true" } end end I think that my problem might have everything to do with this ticket over at jQuery, and tried to implement that code, but, being new to jQuery, it's all a bit over my head. When I say bit, I mean way way. Any ideas to fix it, or a new way to look at it, would be a big help.

    Read the article

  • C# .net How we valiadate a xml with Multiple xml-schemas

    - by allen8374
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://www.MangoDSP.com/schema" xmlns:m1="http://www.onvif.org/ver10/schema"> <SOAP-ENV:Body> <m:CreateView xmlns:m="http://www.MangoDSP.com/mav/wsdl"> <m:View token=""> <m0:Name>View1</m0:Name> <m0:ProfileToken>AnalyticProfile1</m0:ProfileToken> <m0:IgnoreZone> <m0:Polygon> <m1:Point y="0.14159" x="0.12159"/> <m1:Point y="0.24159" x="0.34159"/> <m1:Point y="0.14359" x="0.94159"/> </m0:Polygon> </m0:IgnoreZone> <m0:SceneType>Outdoor</m0:SceneType> <m0:CustomParameters> <m0:CustomParameter> <m0:Name>ViewParam1</m0:Name> <m0:CustomParameterInt>0</m0:CustomParameterInt> </m0:CustomParameter> </m0:CustomParameters> <m0:SnapshotURI><!--This element is ignored for the create view request --> <m1:Uri>http://www.blabla.com</m1:Uri> <m1:InvalidAfterConnect>true</m1:InvalidAfterConnect> <m1:InvalidAfterReboot>true</m1:InvalidAfterReboot> <m1:Timeout>P1Y2M3DT10H30M</m1:Timeout> </m0:SnapshotURI> </m:View> </m:CreateView> </SOAP-ENV:Body> </SOAP-ENV:Envelope> xmlns:m="http://www.MangoDSP.com/mav/wsdl" as localfile:"ma.wsdl" xmlns:m0="http://www.MangoDSP.com/schema" as localfile:"MaTypes.xsd" how can i validate it.

    Read the article

  • Get values of textareas generated dynamically

    - by Hulk
    In the below code,the textaraes are generated dynamically ,now how to get these values for validations in valid() function.. <script> function valid() { //get all textarea vales for validation } function add(col_det) { var row = '<tr>'; row += '<td>'; row += '<textarea rows = "8" cols = "8" class = "input" WRAP id="row_details'+r_count+'" name ="row_details'+r_count+'"></textarea>'; row += '</td>'; for (var i=0;i<col_det.length;i++) { row += '<td> <div id = "div_content_bold"> <textarea rows = "2" cols = "8" class = "input" id="c_details'+c_count+'" name="col_details'+l_count+'" WRAP ></textarea> </div> </td>'; } row += '<td></td>'; row += '</tr>'; return row; } $(document).ready(function() { var cnt = '<input type="text" name="title" id="title" ><br><br>'; cnt += '<table cellspacing="0" cellpadding="0" border="1" width="100%" id="l_table">'; cnt += '<tr>'; cnt += '<th width="30%">Category</th>'; cnt += headers(col_data); cnt += '<th width="10%">Grade obtained</th>'; cnt += '</tr>'; for(var i=0;i<criteria;i++) { cnt += add(col_data,i); } cnt += '</table>'; $('#content').append(cnt); }); </script> <form action="create/" method="post" name="aa"> <div id="content"></div> <table> <tr><td> <input type="submit" value="Save" id="Save" onclick="javascript:var ret=validate(row_c,c_count);return ret;"/></td></tr> Thanks....

    Read the article

  • jquery validation plugin doesn't seem to work ....

    - by Pandiya Chendur
    asp.net mvc's Html.BeginForm() seems to work with jquery validation plugin but the validation plugin doesn't seem to work with a form which i ve added to a page.... This works, <% using (Html.BeginForm("Login", "Registration", FormMethod.Post, new { id = "Loginform" })) {%> <fieldset> <legend>Login</legend> <p> <label for="EmailId">EmailId:</label> <%= Html.TextBox("EmailId", null, new { @class = "text_box_height_14_width_150" })%> </p> <div class="status"></div> <p> <label for="Password">Password:</label> <%= Html.Password("Password",null, new { @class = "text_box_height_14_width_150" }) %> </p> <div class="status"></div> <p> <input type="submit" value="Login" id="login" /> </p> </fieldset> <% } %> But this doesn't work, <form id="Loginform" method="post" action="Registration/Login"> <table cellpadding="0" cellspacing="0" width="100%" style="border:none;"> <tr> <td width="12%">Email Id&nbsp;:&nbsp;</td><td width="15%"> <input id="EmailId" type="text" class="text_box_height_14_width_150 name="EmailId" /></td><td width="20%" class="status"></td> <td width="12%">Password&nbsp;:&nbsp;<td width="15%"><input id="Password" type="password" class="text_box_height_14_width_150 name="Password" /></td> <td width="20%" class="status"></td> <td width="5%"><input type="submit" value="Login" id="BtnLogin" /></td> </tr> </table> </form> and my jquery function has this, $(document).ready(function() { var validator = $("#Loginform").validate({ rules: { EmailId: "required", Password: { required: true, minlength: 6 } }, messages: { EmailId: "Enter your EMail ID", Password: { required: "Please Provide a password", rangelength: jQuery.format("Enter at least {0} characters") } }, // the errorPlacement has to take the table layout into account errorPlacement: function(error, element) { error.appendTo(element.parent().next()); }, // set this class to error-labels to indicate valid fields success: function(label) { // set &nbsp; as text for IE label.html("&nbsp;").addClass("checked"); } }); }); Any suggestion... Am i missing something?

    Read the article

  • trying to validate user input in php

    - by user225269
    I'm trying to validate user input in php. This code will check if the values are null or not. If it is null, this will require the user to input the values that are null. When all the text boxes in the html form that came before this. This code will show the submit button, and that submit button will save the inputted data into the mysql database. But the problem is that the value that is saved is zero zero and zero, what might be the cause of this? <html> <head> <title>Admission Information Sheet</title> <meta http-equiv="Content-Type" content="text/html; Western (ISO-8859-1)"> <meta name="author" content=" "> <title> <style> input { font-size: 16px;} </style> <?php include('header.php'); ?> <div id="main_content"> </div> <?php include('footer.php'); ?> <table border="1" width="900" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1.1" method="POST" action="aisaction.php"> <?php $NURSE = $_POST[nurse]; $TELNUM = $_POST[telnum]; $HOSPNUM = $_POST[hnum]; $ROOMNUM = $_POST[rnum]; $LASTNAME = $_POST[lname]; $FIRSTNAME = $_POST[fname]; $MIDNAME = $_POST[mname]; $AD = $_POST[ad]; $ADATE = $_POST[adate]; $ADTIME = $_POST[adtime]; $CSTAT = $_POST[cs]; $AGE = $_POST[age]; $BDAY = $_POST[bday]; $SEX = $_POST[sex]; ?> <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="12" style="background:#9ACD32; color:white; border:white 1px solid; text-align: center"><strong><font size="3">ADMISSION INFORMATION SHEET</strong></td> </tr> <tr> </td><br> <td width="54"><font size="3">Hospital #</td> <td width="3">:</td> <td width="168"><input type="display" name="hnum" disabled="true" value= "<?php print "$HOSPNUM";?>"><br> <font color="red"> <?php if(empty($HOSPNUM)) print "* Hospital Number required!<br>"; ?> </td> <td width="41"><font size="3">Room #</td> <td width="3">:</td> <td width="168"><input type="display" name="rnum" disabled="true" value= "<?php print "$ROOMNUM";?>"><br> <font color="red"> <?php if(empty($ROOMNUM)) print "* Room Number required!<br>"; ?> </td> <td width="67"><font size="3">Admission Date</td> <td width="3">:</td> <td width="168"><input type="display" name="adate" disabled="true" value= "<?php print "$ADATE";?>"><br> <font color="red"> <?php if(empty($ADATE)) print "* Admission Date required!<br>"; ?> </td> </tr> <tr> <td><font size="3">Last Name</td> <td>:</td> <td><input type="display" name="lname" disabled="true" value= "<?php print "$LASTNAME";?>"><br> <font color="red"> <?php if(empty($LASTNAME)) print "* Last Name required!<br>"; ?> </td> <td><font size="3">First Name</td> <td>:</td> <td><input type="display" name="fname" disabled="true" value= "<?php print "$FIRSTNAME";?>"><br> <font color="red"> <?php if(empty($FIRSTNAME)) print "* First Name required!<br>"; ?> </td> <td><font size="3">Middle Name</td> <td>:</td> <td><input type="display" name="mname" disabled="true" value= "<?php print "$MIDNAME";?>"><br> <font color="red"> <?php if(empty($MIDNAME)) print "* Middle Name required!<br>"; ?> </td> <td><font size="3">Admit time</td> <td>:</td> <td><input type="display" name="mname" disabled="true" value= "<?php print "$ADTIME";?>"><br> <font color="red"> <?php if(empty($ADTIME)) print "* Adtime required!<br>"; ?> </td> </tr> <tr> <td><font size="3">Civil Status</td> <td>:</td> <td><input type="display" name="cs" disabled="true" value= "<?php print "$CSTAT";?>"><br> <font color="red"> <?php if(empty($CSTAT)) print "* Civil Status required!<br>"; ?> </td> <td><font size="3">Age</td> <td>:</td> <td><input type="display" name="age" disabled="true" value= "<?php print "$AGE";?>"><br> <font color="red"> <?php if(empty($AGE)) print "* Age required!<br>"; ?> </td> <td><font size="3">Birthday</td> <td>:</td> <td><input type="display" name="bday" disabled="true" value= "<?php print "$BDAY";?>"><br> <font color="red"> <?php if(empty($BDAY)) print "* Birthday required!<br>"; ?> </td> </tr> <tr> <td><font size="3">Address</td> <td>:</td> <td><input type="display" name="address" disabled="true" value= "<?php print "$AD";?>"><br> <font color="red"> <?php if(empty($AD)) print "* Address required!<br>"; ?> </td> <td><font size="3">Telephone #</td> <td>:</td> <td><input type="display" name="telnum" disabled="true" value= "<?php print "$TELNUM";?>"></td> <td width="23"><font size="3">Sex</td> <td width="3">:</td> <td width="174"><input type="display" name="sex" disabled="true" value= "<?php print "$SEX";?>"><br> <font color="red"> <?php if(empty($SEX)) print "* Gender required!<br>"; ?> </td> </tr> <tr> <td><font size="3">Pls. Check</td> <td>:</td> <td><input name="stats1" type="checkbox" id="SSS" value="SSS">SSS</td> <td><font size="3"></td> <td>:</td> <td><input name="stats1" type="checkbox" id="nonmed" value="NonMedicare">Non Medicare</td> <td><font size="3"></td> <td>:</td> <td><input name="stats1" type="checkbox" id="sh" value="stockholder">Stockholder</td> </tr> <tr> <td><font size="3"></td> <td></td> <td><input name="stats1" type="checkbox" id="gsis" value="GSIS">GSIS</td> <td><font size="3"></td> <td></td> <td><input name="stats1" type="checkbox" id="senior" value="seniorcitizen">Senior-Citizen</td> <tr> <td><font size="3"></td> <td></td> <td><input name="stats1" type="checkbox" id="dep" value="dependent">Dependent</td> <td><font size="3"></td> <td></td> <td><input name="stats1" type="checkbox" id="emp" value="employee">Employee</td> </tr> <tr> <td><font size="3">Attending Nurse</td> <td>:</td> <td><input type="display" name="nurse" disabled="true" value= "<?php print "$NURSE";?>"><br> <font color="red"> <?php if(empty($NURSE)) print "* Admitting/Attending Nurse required!<br>"; ?> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><input type="button" value="Back" onClick="history.go(-1);return true;"> <?php $val1 = $_POST['NURSE']; if($_POST['NURSE'] !="") { ?> <form action="aisaction.php" method="POST" target="_window"> <input type="hidden" name="submit" value="yes"> <input type="submit" value="submit"> </form> <?php } ?> </td> </td> </tr> </table> </td> </form> </tr> </table> </head> </html>

    Read the article

  • jQuery Validation hiding or tearing down jquery Modal Dialog on submit

    - by Programmin Tool
    Basically when clicking the modal created submit button, and calling jQuery('#FormName').submit(), it will run the validation and then call the method assigned in the submitHandler. After that it is either creating a new modal div or hiding the form, and I don't get why. I have debugged it and noticed that after the method call in the submitHandler, the form .is(':hidden') = true and this is true for the modal div also. I'm positive I've done this before but can't seem to figure out what I've done wrong this time. The odd this is a modal div is showing up on the screen, but it's completely devoid of content. (Even after putting in random text outside of the form. It's like it's a whole new modal div) Here are the set up methods: function setUpdateTaskDiv() { jQuery("#UpdateTaskForm").validate({ errorLabelContainer: "#ErrorDiv", wrapper: "div", rules: { TaskSubject: { required: true } }, messages: { TaskSubject: { required: 'Subject is required.' } }, onfocusout: false, onkeyup: false, submitHandler: function(label) { updateTaskSubject(null); } } ); jQuery('#UpdateDiv').dialog({ autoOpen: false, bgiframe: true, height: 400, width: 500, modal: true, beforeclose: function() { }, buttons: { Submit: function() { jQuery('#UpdateTaskForm').submit(); }, Cancel: function() { ... } } }); where: function updateTaskSubject(task) { //does nothing, it's just a shell right now } Doesn't really do anything right now. Here's the html: <div id="UpdateDiv"> <div id="ErrorDiv"> </div> <form method="post" id="UpdateTaskForm" action="Calendar.html"> <div> <div class="floatLeft"> Date: </div> <div class="floatLeft"> </div> <div class="clear"> </div> </div> <div> <div class="floatLeft"> Start Time: </div> <div class="floatLeft"> <select id="TaskStartDate" name="TaskStartDate"> </select> </div> <div class="clear"> </div> </div> <div> <div class="floatLeft"> End Time: </div> <div class="floatLeft"> <select id="TaskEndDate" name="TaskEndDate"> </select> </div> <div class="clear"> </div> </div> <div> <div class="floatLeft"> Subject: </div> <div class="floatLeft"> <textarea id="TaskSubject" name="TaskSubject" cols="30" rows="10"></textarea> </div> <div class="clear"> </div> </div> <div> <input type="hidden" id="TaskId" value="" /> </div> <div class="clear"></div> </form> </div> Odd Discovery Turns out that the examples that I got this to work all had the focus being put back on the modal itself. For example, using the validator to add messages to the error div. (Success or not) Without doing this, the modal dialog apparently thinks that it's done with what it needs to do and just hides everything. Not sure exactly why, but to stop this behavior some kind of focus has to be assigned to something within the div itself.

    Read the article

  • jQuery programmatically removing validation highlighting

    - by Sam Carleton
    The form has two check boxes (cbDeclined & cbIsOOfFac), two text fields and a drop down (txtHeight, txtWeight, ddlDevice). If either check box is checked, then the other controls are disabled and the rules for the other do no apply. Here are the current rules: $('form').validate({ highlight: function (element, errorClass) { $(element).addClass("invalidElem"); }, unhighlight: function (element, errorClass) { $(element).removeClass("invalidElem"); }, errorPlacement: function (error, element) { var parent = element.parent(); parent.append(error); }, errorElement: "div", errorClass: "errorMsg" }); function HeightWeightCtrlsEnabled() { return !cbDeclined.is(':checked') && !cbIsOOfFac.is(':checked'); } txtHeight.rules("add", { required: function (element) { return HeightWeightCtrlsEnabled(); }, maxlength: 3, min: 1, digits: true }); txtWeight.rules("add", { required: function (element) { return HeightWeightCtrlsEnabled(); }, maxlength: 4, min: 1, digits: true }); ddlDevice.rules("add", { required: function (element) { return HeightWeightCtrlsEnabled(); } }); function UpdateTextBoxes() { var disableCtrls = !HeightWeightCtrlsEnabled(); txtHeight.prop('disabled', disableCtrls); txtWeight.prop('disabled', disableCtrls); ddlDevice.prop('disabled', disableCtrls); if (disableCtrls) { txtHeight.val(''); txtWeight.val(''); ddlDevice.val(''); } } cbDeclined.click(function () { if (cbDeclined.is(':checked')) cbIsOOfFac.attr('checked', false); UpdateTextBoxes(); }); cbIsOOfFac.click(function () { if (cbIsOOfFac.is(':checked')) cbDeclined.attr('checked', false); UpdateTextBoxes(); }); The problem comes in when: The user enters something into txtWeight, clicks the submit to get both ddlDevice & txtHeight to highlight because they are required, then... The user clicks on either cbDeclined & cbIsOOfFac. The highlight is NOT going away. I am trying to figure out how to get the highlighting around the height and drop down to go away. I tried to create a fully working jsFiddler, but I cannot get anything to work, though everything looks correct. here is the link (I cannot post links, so I expanded it a bit) jsfiddle dot net/scarleton/9hDZQ/12/ If you remove the last /12/, you will see my first version that is a cut/paste from the real thing. Per a suggestion I tried adding $('form').valid(); a number of places. When I added it to the end of the UpdateTextBoxes() function, they started out highlighted, not what I want. When I added it after the click() event of either of the radio button, the text would go away, but the actual controls stayed highlighted. It looks like the function on the required property of the rule is not fully working, maybe. What is really interesting is this: When I enter a height, click , then weight and device are highlighted and have the error message under them. When I click on one of the radio buttons, the text goes away, but the highlight does not. But... The height is NOT highlighted, it stays normal.

    Read the article

  • jQuery custom validation for a selected radio selection

    - by Kaushik Gopal
    Hey peeps, This is my requirement: I have a bunch of radio box selections (types of workflows). If one of the radios are selected(i.e one particular type of workflow selected), I want to run a custom validation on that. This is what i tried, but it's not behaving well. Any help? jQuery part: $(document).ready(function() { // this part is to expand the child radio selection if particular parent workflow selected $("#concernedDirectorChoice").hide(); $("input[name^=workflowChoice]").change( function (){ if($(this).attr("class")=='chooseDir'){ $("#concernedDirectorChoice").show(); }else{ $("#concernedDirectorChoice").hide(); } }); // FORM VALIDATION $.validator.addMethod("dirRequired", function(value, element) { return this.optional(element) || ($("input[name^=rdDir:checked]").length); }, "That particular workflow requires a Director to be chosen. Please select Director"); $("#contExpInitiateForm").validate({ debug:true ,rules:{ RenewalNo: {required: true, number: true}, chooseDir: {dirRequired: true}, workflowChoice: {required: true} } ,errorPlacement: function(error, element) { $('.errorMessageBox').text(error.html()); } }); }); HTML form part: <!-- Pick type of workflow --> <table class="hr-table" > <tr> <td class="hr-table-label " colspan=2 >Pick Workflow Type</td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="1"> </input> </td> <td> Workflow 1 </td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="2" class="chooseDir"> </input> </td> <td> Workflow 2 (Dir selection required) </td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="3"> </input> </td> <td> Workflow 3 </td> </tr> </table> <!-- Pick Director for Workflow type 2 --> <table id="concernedDirectorChoice" name="concernedDirectorChoice" > <tr><td class="hr-table-label" colspan=2 > Choose Concerned Director</td></tr> <tr> <td><input type="radio" value='Dir1' name="rdDir" /></td> <td>Director 1</td> </tr> <tr> <td><input type="radio" value='Dir2' name="rdDir" /></td> <td>Director 2</td> </tr> <tr> <td><input type="radio" value='Dir3' name="rdDir" /></td> <td>Director 3</td> </tr> </table>

    Read the article

  • Jquery validation in asp.net mvc

    - by Suja
    I have a view to create a DocumentTemplate <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" % <%@ Import Namespace="HexsolveMVC.Helpers" % Create <script type="text/javascript"> $(document).ready(function() { $("#reset").click(function(event) { $("#Part").get(0).selectedIndex = 0; $("#txtDocTitle").val(""); $("#txtarDocDesc").val(""); }); }); }); </script> <div class="container"> <div class="outer"> <div class="main_content"> <div> <%=Html.BreadCrumb(Model.BreadCrumbs)%> </div> <div class="form_container"> <h1> Document Template</h1> <ul> <li> <label> <span class="mandatory">*</span>Engine model:</label> <%=Html.DropDownList("Part", (SelectList)ViewData["Part"])%> <span class="tagline">Please select the engine model <%--<a href="#">Need Help</a>--%></span> </li> <li> <label> <span class="mandatory">*</span>Document Title:</label> <input id="txtDocTitle" name="docTitle" type="text" class="formstyle" /> </li> <li> <label> Discription:</label> <textarea name="docDesc" id="txtarDocDesc" cols="45" rows="5"></textarea> </li> <li> <div class="button_panel"> <input name="button" type="submit" class="btn_create_doc_big" id="button" value="Create" /> <span class="reset_field"><a href="#" id="reset">Reset the form</a></span><span class="mandatory_tag">[ <span class="mandatory">*</span> Mandatory fields ]</span> <div class="clear"> </div> </div> <span class="tagline">By clicking on '<span class="tagline_highlight">Create</span>' button your document will be created.<br /> And after you can add new instructions and subsections easily.</span></li> </ul> <div> <h2> Example of how to work a document </h2> <img alt="" src="../../html/images/diagram.jpg" width="738" height="172" /></div> </div> </div> <div class="clear"> </div> </div> </div> I need to validate the txtDocTitle since its a required field. How can i do this using jQuery. I cannot use Model validation coz this same model is used for other views also and it have properties from other tables. I need something to do with jQuery.

    Read the article

  • jquery: validate that text field is numeric

    - by George Johnston
    I have simple issue -- I would like to check a field to see if it's numeric if it is not blank. I'm not using any additional plugins, just jQuery. My code is as follows: if($('#Field').val() != "") { if($('#Field').val().match('^(0|[1-9][0-9]*)$')) { errors+= "Field must be numeric.<br/>"; success = false; } } ...It doesn't seem to work. Where am I going wrong? Thanks, George

    Read the article

  • Android: How can I validate EditText input?

    - by Stefan
    I need to do form validation on a series of EditTexts. I'm using OnFocusChangeListeners to trigger the validation, but this doesn't behave as desired for the final EditText. If I click on the "Done" button while typing into the final EditText then the InputMethod is disconnected, but technically focus is never lost on the EditText (and so validation never occurs). What's the best solution? Should I be monitoring when the InputMethod unbinds from each EditText rather than when focus changes? If so, how?

    Read the article

  • MVC2: Validate PartialView before Form Submit of Page containing Partial View

    - by Pascal
    I am using asp.net mvc2 and having a basic Page that includes a Partial View within a form <% using (Html.BeginForm()) { %> <% Html.RenderAction("partialViewActionName", "Controllername"); %> <input type="submit" value="Weiter" /> <% } %> When I submit the form, the httpPost Action of my Page is called, and AFTER that the httpPost Action of my Partial View is called [HttpPost] public virtual ActionResult PagePostMethod(myModel model) { // here I should know about the validation of my partial View // If partialView.ModelState is valid then // return View("success"); // else return View(model) } [HttpPost] public virtual ActionResult partialViewActionName(myModel model) { ModelState.AddModelError("Error"); return View(model); } But as I am doing the Validation in the httpPost Method of my Partial View (because I want to use my Partial View in several Places) I cant decide if my hole page is valid or not. Has anyone an Idea how I could do this? Isn´t it a common task to have several partial Views in a page but have the information about validation in the page action methods? Thanks very much for your help!!

    Read the article

  • Validate checkboxes in MVC form

    - by Frode Lillerud
    Hi, I have a table in an ASP.NET MVC2 form. On each row in the table there is a checkbox. Underneath the table there is a submitbutton. I want to make the button disabled when NONE of the checkboxes are selected. <% using Html.BeginForm(....) { %> <table> <% foreach (var item in Model) { %> <tr> <td> <input type="checkbox" name="selectedContacts" /> </td></tr> <% } //End foreach %> </table> <% } //End using %> <input type="submit" value="Create selection" name="CreateSelectionAction" /> The number of lines/checkboxes will vary from 1 to many. How can I use MVC2/jQuery to require the user to selected minimum one checkbox before clicking Submit button? Edit; Of the three answers below I couldn't get any of them to work. Nothing happens when clicking the checkboxes, and no Javascript errors are raised. Setting up a small bounty.

    Read the article

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