$("value")为null - > jQuery

Jes*_*zie 1 javascript validation jquery jquery-validate

我正在尝试使用jquery表单验证器实现客户端验证,但我已按照指南进行了搜索,并在谷歌搜索我的问题的答案,可能存在冲突,prototype.js 我已将行添加var JQuery = jQuery.noConflict();到我的jquery-1.5.1.min.js文件底部.

萤火虫还在说 $("#contact") is null $("#contact").validationEngine();

我将所需的javascript和jQuery代码加载到我的主页面中,template.php file然后调用一个view被叫联系人.

联系页面视图:

 <section id="content" class="contact-us">
        <h1>Contact</h1>

<div id ="formLayout" class="contactForm">

<section id = "validation"></section>

<form action=contact" method="post" accept-charset="utf-8" id="contact" name="contact">

<fieldset>

<label><label for="name">Name:</label><span class="small">Required Field - Text</span></label>

<input type="text" name="name" value="" id="name" class="validate[required[custom[onlyLetterSp]]]"  />

<div id="error"></div>

<label><label for="email">Email:</label><span class="small">Required Field - yourname@example.com</span></label>

<input type="text" name="email" value="" id="email" class="validate[required[custom[onlyLetterSp]]]"  />

<div id="error"></div>

<label><label for="phone">Phone:</label><span class="small">Required Field - 021214589</span></label>

<input type="text" name="phone" value="" id="phone" class="validate[required[custom[onlyLetterSp]]]"  />

<div id="error"></div>

<label><label for="message">Message:</label><span class="small">Required Field - Text</span></label>

<textarea name="message" cols="90" rows="12" id="message" class="validate[required[custom[onlyLetterSp]]]" >

</textarea><div id="error"></div>

<input type="submit" name="submit" value="Submit"  />

</fieldset>

</form>

</div>  

    </section>
</div>
    <div class="clear"></div>

    <footer>&copy; Housemovers LTD 2011</footer>

    </div> <!-- Wrapper Close -->
<script type="text/javascript" src="http://jesse.mckenzie.natcoll.net.nz/_Assignments/Industry/includes/js/jquery-1.5.1.min.js"></script>
<script src="/includes/js/lightbox/prototype.js" type="text/javascript"></script> 
<script src="/includes/js/lightbox/scriptaculous.js?load=effects,builder" type="text/javascript"></script> 
<script src="/includes/js/lightbox/lightbox.js" type="text/javascript"></script>
<script src="includes/js/jquery.validationEngine-en.js"type="text/javascript"></script> 
<script src="/includes/js/jquery.validationEngine.js"type="text/javascript"></script> 

<script type="text/javascript"> 
     JQuery(document).ready(function(){
      $("#contact").validationEngine();
       });
    </script>

</body>
Run Code Online (Sandbox Code Playgroud)

Mar*_*ahn 5

改为

jQuery("#contact")
Run Code Online (Sandbox Code Playgroud)

所述.noConflict()去除$结合的jQuery