test
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • pmichael Friend
    #167252

    To validate custom contact form with Jquery.js and Jquery.validate.js and some of javascript, can you tell me where to save js file and write the scripts?

    Trimud Friend
    #405437

    Hi,

    in Your template settings go to Layouts tab and click edit on the Default layout.

    Under </stylesheets> add

    <scripts>
    <file>js/jquery.js</file>
    <file>js/jquery.validate.js</file>
    </scripts>

    After this upload both files in templates/ja_travel/js

    But first be sure that jquery.js is not yat loaded by some other joomla extension by checking sites source code.

    Regards

    pmichael Friend
    #405463

    Thanks. After I add
    <scripts>
    <file>js/jquery.js</file>
    <file>js/jquery.validate.js</file>
    </scripts>
    on the default layout xml file. However, slideshow on home page, mega menu and validation process don’t work at all. When I check the source code , there were two jquery.js even though those are not in the same folder. Will you advise me any other solution? Also, where do I put <script> code that is usually located in HTML page, such as

    <script>
    $(document).ready(function(){
    $(“#webtoleadForm”).validate();// Your code here
    });

    </script>

    Trimud Friend
    #405472

    If jQuery is loaded 2 times remove:

    <file>js/jquery.js</file>

    Please read about jQuery noconflict mode here: http://www.google.bg/search?client=browser-rockmelt&channel=omniboxaq=1&oq=jquery+noco&sourceid=chrome&ie=UTF-8&q=jquery+noconflict+joomla

    Why don’t you add custom JS to the form you created?

    Regards

    pmichael Friend
    #405492

    I found 2 jquery.js file inside following folder.

    C:xampphtdocspaytmediacom_akeebajs and C:xampphtdocspaytpluginssystemjapopupthickboxjs

    1. Can I remove only <file>js/jquery.js</file> or else?
    2. Do I have to add another path to jquery.js on

    Inside default layout xml file
    <scripts>
    <file>js/jquery.js</file>
    <file>js/jquery.validate.js</file>
    </scripts>

    3. How about <file>js/jquery.validate.js</file> ? Can I leave it as it is?

    4. Where can I add custom js? Do you mean between <form> </form> tag? I tried to put custom js code outside <form>tag , but it didn’t work.

    Many thanks in advance.

    Phill Moderator
    #405499

    If you are writing your own js why not use mootools rather than jQuery. That will avoid conflicts.

    pmichael Friend
    #405504

    I am not familiar with setting up validation on the form field. I heard that jQuery is the solution to validate each field. Can you tell me what is the best option for me? I am trying to put following form as attached inside single article. jQuery validation plugin works fine on one html page, but it is hard to put joomlart template. Regards,


    1. form
    Phill Moderator
    #405509

    Just to get things straight, you simply want a custom form yes? There are simple components that you can use to generate those for you and will save all the messing about coding your own.

    jQuery can be used or mootools can be used. They are basically the same thing but when you mix them on the same page you will get problems. This is especially true with Joomla as Joomla ships with Mootools and JA templates make extensive use of that. The reason your code is killing the menus etc is simply a conflict of the two libraries and you could use the jQuey no conflict mode. In my mind however simply using one of the custom forms plugins for Joomla, preferably one that uses moo, is a simpler and probably better way to go.

    pmichael Friend
    #405522

    Can you suggest one of forms plugins that uses moo? Actually the custom form is generated based on Salesforce.com web-to-lead code.

    Phill Moderator
    #405526

    If the form is generated by a third party component then probably best to ask them to add validation code.

    If you want to create a form of your own then you could either try one of the cudtom contact form plugins available here – http://extensions.joomla.org/extensions/contacts-and-feedback/contact-forms

    Or create your own form using one of the components here –
    http://extensions.joomla.org/extensions/contacts-and-feedback/forms

    I use chrono forms as it is free and simple to use. Which is best for you is hard to say, give some a go and see if they fit your needs.

Viewing 10 posts - 1 through 10 (of 10 total)

This topic contains 10 replies, has 3 voices, and was last updated by  Phill 13 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum