javascript - my form is not validate with jquery validate function -
this question has answer here:
my form not validate jquery validate function
<head> <!-- basic page needs ================================================== --> <meta charset="utf-8"> <title>referrals | india</title> <meta name='description' content='at veepal, work on web development , web application development projects based on proven project development methodology (sdlc).'/> <link rel="canonical" href="http://www.veepal.com/why-veepal" /> <meta name='robots' content='noodp'/> <meta name='google-site-verification' content='kplsxtapqnxguygv1gajjqhdjagl6skg0f47pe7n3oo' /> <meta name="msvalidate.01" content="5d74c2d02269a257714752651f59c85a" /> <meta name="alexaverifyid" content="0ztaiy6o4wrst4zib8itaapixee" /> <meta name="avgthreatlabs-verification" content="3ccfecf442587cd1d7a938645f6adb99cbb6e1c5" /> <meta name="p:domain_verify" content="a4b905b4d212fdffdbe48e61ff04ba06"/> <link rel="author" href="https://plus.google.com/+veepal/posts"/> <link rel="publisher" href="https://plus.google.com/102356317964360660690"/> <meta property="og:title" content="offshore development | web design & web application development | india"/> <meta property="og:description" content="at veepal, work on web development , web application development projects based on proven project development methodology (sdlc)."/> <meta property="og:locale" content="en_us"/> <meta property="og:type" content="website"/> <meta property="og:url" content="http://www.veepal.com/"/> <meta property="og:site_name" content="veepal services"/> <meta property="article:publisher" content="https://www.facebook.com/software.development.india"/> <meta property="fb:admins" content="146507655407127" /> <meta name="twitter:card" content="summary"/> <meta name="twitter:site" content="@veepal"/> <meta name="twitter:creator" content="@veepal"/> <meta name="twitter:title" content="veepal services"> <!-- mobile specific metas ================================================== --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <!-- css ================================================== --> <!-- css nivo slider --> <link rel="stylesheet" href="stylesheets/themes/default/default.css"> <link rel="stylesheet" href="stylesheets/nivo-slider.css"> <link rel="stylesheet" href="stylesheets/nivo-style.css"> <!-- css site style --> <link rel="stylesheet" href="stylesheets/base.css"> <link rel="stylesheet" href="stylesheets/skeleton.css"> <link rel="stylesheet" href="stylesheets/layout.css"> <link rel="stylesheet" href="stylesheets/buttons.css"> <link rel="stylesheet" href="stylesheets/mediaquery.css"> <!--[if lt ie 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!--[if ie 9]> <link rel="stylesheet" href="stylesheets/layout-ie9.css"> <![endif]--> <!--[if ie 8]> <link rel="stylesheet" href="stylesheets/layout-ie8.css"> <![endif]--> <!-- favicons ================================================== --> <link rel="stylesheet" href="stylesheets/form1.css"> <!-- <link rel="stylesheet" href="stylesheets/form.css">--> <link rel="shortcut icon" href="images/favicon.ico"> <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> <script> (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-20533631-1', 'veepal.com'); ga('send', 'pageview'); </script> <link href='http://fonts.googleapis.com/css?family=raleway:400,500,300,700' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=open+sans:400,600,700' rel='stylesheet' type='text/css'> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <!-- <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script> <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js"></script> --> <!--<script src="//code.jquery.com/jquery-1.12.0.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script> --> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> <!--<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script> --> <script type="text/javascript"> $(document).ready(function() { $("#myform").validate({ rules: { username: "required", email: { required: true, email: true }, phoneno : "required", referrals : "required" }, messages: { username: "please enter name", email: "please enter email", phoneno : "please enter phone number", referrals :"please enter details" }, submithandler: function(form) { form.submit(); } }); }); </script> </head>
<form method="post" action="<?php echo htmlspecialchars($_server["php_self"]);?>" id="myform" novalidate="novalidate"> <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="padding-left:10px;"> <!--<tr> <td class="contact-form-heading" colspan="3">hire our professionals</td> </tr>--> <tr id="response"> <td colspan="3"></td> </tr> <tr> <td width="25%" class="contact-form">name: (required)</td> </tr> <tr><td width="70%" class="contact-text-form"><input type="text" class="contact-form-filds" name="username" id="username" width="50%" required></td></tr> <tr> <td class="contact-form">e-mail: (required)</td> </tr> <tr> <td width="70%" class="contact-text-form"><input type="email" class="contact-form-filds" name="email" id="email"></td> </tr> <tr> <td class="contact-form">telephone: (required)</td> </tr> <tr><td width="70%" class="contact-text-form"><input type="text" class="contact-form-filds" name="phoneno" id="phoneno"></td> </tr> <tr> <td class="contact-form">details of company / person being referred: (required)</td> </tr> <tr><td class="contact-text-form"><textarea name="referrals" class="contact-form-filds2" id="referrals" cols="1000" rows="3" ></textarea></td> </tr> <tr> <td width="75"><input type="submit" name="formsubmit" value="submit" class="btnsubmit"></td> <td> </td> </tr> </table> </form> </form>
my form not validate jquery validate() function.the error typeerror: $(...).validate not function.jquery validation plugin not working after adding script in head tag.
you need add "html" tag before "head" tag , keep form in body tag. validates form
Comments
Post a Comment