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

Extend the Form Properties tab


  1. manuel
    Member

    Hello Yuniar.

    I'm trying to extend the Form Properties tab of edit_form.php, to add another checkbox below "Limit One Entry Per User".

    For example, it would be called "Verify info".

    What I've done is:
    * Added a field on the ap_forms table (called it form_verifyinfo).
    * Added markup, js and php in edit_form.php
    `
    $form->verifyinfo = $row['form_verifyinfo'];

    </code>
    (...)
    <code>

    <input id="form_verifyinfo" class="checkbox" value="" tabindex="7" type="checkbox"
    onclick="if (this.checked){ update_form('1', 'verifyinfo')} else {update_form('0', 'verifyinfo')};"
    <? if ($form->verifyinfo == 1){ echo 'checked';} ?>>
    `

    As you can see, I'm doing update_form('1', 'verifyinfo')...

    I also tried adding this manually into main_form (by adding onload main_form['data']['verifyinfo']=1;)

    But it doesn't get into the DB... What am I missing? Having a non-obfuscated version of the JS would help, but I can see you have your reasons for doing that :)

    Posted 16 years ago #
  2. manuel
    Member

    (btw I did my best to format the code, but not having a preview it got a bit messed up, sorry about that!)

    Posted 16 years ago #
  3. yuniar

    Hello manuel,

    I'm sorry, but to extend the form properties you will need to modify the javascript indeed. Which unfortunately being obfuscated for a reason :(

    One idea for this would be setting up an onClick event to your "Verify" checkbox.
    So whenever your checkbox is checked/unchecked it sends ajax request silently in the background to modify ap_forms table.


    MachForm Founder

    Posted 16 years ago #
  4. manuel
    Member

    Yuniar, hi, and thanks for clarifying this.
    Seems that's what we'll have to do :)
    - Manuel

    Posted 16 years ago #

RSS feed for this topic

Reply