This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Adding external javascript to form


  1. kmac
    Member

    Hi,

    Great application, but I'm finding it difficult to add some customizations.

    1. I need to add an external javascript file -
    (e.g. <script type="text/javascript" src="js/items.js"></script>)

    How would I go about this?

    2. Due to the form having many sections containing optional checkboxes, I was planning on toggling these sections with tabs.

    I noticed you use jquery-tabs.js for the admin area, namely the "Embed Code" area.
    Again, I'm finding it's difficult to implement this in the usual manner.

    Again, is this possible?

    Cheers & thanks in advance for any help with this,
    Kmac

    Posted 15 years ago #
  2. yuniar

    1. You will need to modify "includes/view-functions.php" file. Search around line 1825 and you'll see the form markup. Simply insert your javascript code inside the head tag.

    2. I'm afraid this one won't be quite easy to do. This would require pretty much customization.


    MachForm Founder

    Posted 15 years ago #
  3. kmac
    Member

    Hi Yuniar,

    Thanks for replying. That worked a treat.
    Now for the script to work correctly, I realized I need to add "onclick="tally()" to a number of checkbox fields.

    Would I use something like this in view-functions.php:

    $('#element_57_1').click(function(){
    tally()
    }

    For the tabbed view I was hoping for, I decided to go with the jquery show/hide toggle instead - which works great!

    Posted 15 years ago #
  4. carrolm
    Member

    Hi kmac,

    I'm trying to add tab's to a form of mine that has got very long, would it be possible to see the code you added to enable the jquery tabs on your form?

    best regards & thanks for any help given,

    carrolm

    Posted 14 years ago #

RSS feed for this topic

Reply