I have used Ajax link and live validation in index.rhtml Ajax link requires JavaScript "prototype" and live validation requires "jquery". i got "element.dispatchEvent is not a function" on the firebug console when i used "prototype" and "jquery" in same page index.rhtml after i removed javascript "prototype" library, i got "Ajax is not defined" on the firebug console when i clicking ajax link. how can i use both ajax and jquery in the same page? Can anybody give me a solution for this?
For example:
<%=javascript_include_tag "prototype"%> <%=javascript_include_tag "jquery"%> <%= javascript_include_tag 'livevalidation/jquery.validate' %> <%= javascript_include_tag 'livevalidation/jquery.validation.functions' %> <%= stylesheet_link_tag 'livevalidation/jquery.validate' %> <%= stylesheet_link_tag 'livevalidation/style' %>
<%=link_to_remote "new user",:url=>{:action=>:a},:update=>"div"%> <div id="div"></div> <% form_for(@user) do |f| %> <p> <%= f.label :name %><br /> <%= f.text_field :name %><br /> </p> <p> <%= f.submit "Register"%> </p> <% end %> <script type="text/javascript"> jQuery(function(){ jQuery("#user_name").validate({ expression: "if (VAL) return true; else return false;", message: "Please enter the Password" });}); </script>